-
Notifications
You must be signed in to change notification settings - Fork 3
/
load_balancer_listeners.go
51 lines (45 loc) · 2.48 KB
/
load_balancer_listeners.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package cloudscale
import (
"time"
)
const loadBalancerListenerBasePath = "v1/load-balancers/listeners"
type LoadBalancerPoolStub struct {
HREF string `json:"href,omitempty"`
UUID string `json:"uuid,omitempty"`
Name string `json:"name,omitempty"`
}
type LoadBalancerListener struct {
TaggedResource
// Just use omitempty everywhere. This makes it easy to use restful. Errors
// will be coming from the API if something is disabled.
HREF string `json:"href,omitempty"`
UUID string `json:"uuid,omitempty"`
Name string `json:"name,omitempty"`
Pool *LoadBalancerPoolStub `json:"pool,omitempty"`
LoadBalancer LoadBalancerStub `json:"load_balancer,omitempty"`
Protocol string `json:"protocol,omitempty"`
ProtocolPort int `json:"protocol_port,omitempty"`
AllowedCIDRs []string `json:"allowed_cidrs,omitempty"`
TimeoutClientDataMS int `json:"timeout_client_data_ms,omitempty"`
TimeoutMemberConnectMS int `json:"timeout_member_connect_ms,omitempty"`
TimeoutMemberDataMS int `json:"timeout_member_data_ms,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
}
type LoadBalancerListenerRequest struct {
TaggedResourceRequest
Name string `json:"name,omitempty"`
Pool string `json:"pool,omitempty"`
Protocol string `json:"protocol,omitempty"`
ProtocolPort int `json:"protocol_port,omitempty"`
AllowedCIDRs []string `json:"allowed_cidrs,omitempty"`
TimeoutClientDataMS int `json:"timeout_client_data_ms,omitempty"`
TimeoutMemberConnectMS int `json:"timeout_member_connect_ms,omitempty"`
TimeoutMemberDataMS int `json:"timeout_member_data_ms,omitempty"`
}
type LoadBalancerListenerService interface {
GenericCreateService[LoadBalancerListener, LoadBalancerListenerRequest, LoadBalancerListenerRequest]
GenericGetService[LoadBalancerListener, LoadBalancerListenerRequest, LoadBalancerListenerRequest]
GenericListService[LoadBalancerListener, LoadBalancerListenerRequest, LoadBalancerListenerRequest]
GenericUpdateService[LoadBalancerListener, LoadBalancerListenerRequest, LoadBalancerListenerRequest]
GenericDeleteService[LoadBalancerListener, LoadBalancerListenerRequest, LoadBalancerListenerRequest]
}