Documentation
¶
Index ¶
- Variables
- type ACL
- type ACLAction
- type ACLArgument
- type ACLCondition
- type ACLNotFoundError
- type ACLTemplateAction
- type ACLTemplateArgument
- type ACLTemplateCondition
- type ACLTemplates
- type AccessIP
- type AccessIPNotFoundError
- type Bind
- type BindNotFoundError
- type Certificate
- type CertificateNotFoundError
- type Cluster
- type ClusterNotFoundError
- type CreateACLRequest
- type CreateAccessIPRequest
- type CreateBindRequest
- type CreateCertificateRequest
- type CreateListenerRequest
- type CreateTargetGroupRequest
- type CreateTargetRequest
- type CreateVIPRequest
- type Deployment
- type DeploymentNotFoundError
- type Listener
- type ListenerGeoIP
- type ListenerGeoIPRequest
- type ListenerGeoIPRestriction
- type ListenerNotFoundError
- type LoadBalancerService
- type Mode
- type PatchACLRequest
- type PatchAccessIPRequest
- type PatchBindRequest
- type PatchCertificateRequest
- type PatchClusterRequest
- type PatchListenerRequest
- type PatchTargetGroupRequest
- type PatchTargetRequest
- type PatchVIPRequest
- type Service
- func (s *Service) CreateACL(req CreateACLRequest) (int, error)
- func (s *Service) CreateListener(req CreateListenerRequest) (int, error)
- func (s *Service) CreateListenerAccessIP(listenerID int, req CreateAccessIPRequest) (int, error)
- func (s *Service) CreateListenerBind(listenerID int, req CreateBindRequest) (int, error)
- func (s *Service) CreateListenerCertificate(listenerID int, req CreateCertificateRequest) (int, error)
- func (s *Service) CreateTargetGroup(req CreateTargetGroupRequest) (int, error)
- func (s *Service) CreateTargetGroupTarget(groupID int, req CreateTargetRequest) (int, error)
- func (s *Service) DeleteACL(aclID int) error
- func (s *Service) DeleteAccessIP(accessID int) error
- func (s *Service) DeleteListener(listenerID int) error
- func (s *Service) DeleteListenerBind(listenerID int, bindID int) error
- func (s *Service) DeleteListenerCertificate(listenerID int, certificateID int) error
- func (s *Service) DeleteTargetGroup(groupID int) error
- func (s *Service) DeleteTargetGroupTarget(groupID int, targetID int) error
- func (s *Service) DeployCluster(clusterID int) error
- func (s *Service) DisableListenerGeoIP(listenerID int) error
- func (s *Service) GetACL(aclID int) (ACL, error)
- func (s *Service) GetACLs(parameters connection.APIRequestParameters) ([]ACL, error)
- func (s *Service) GetACLsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[ACL], error)
- func (s *Service) GetAccessIP(accessID int) (AccessIP, error)
- func (s *Service) GetBinds(parameters connection.APIRequestParameters) ([]Bind, error)
- func (s *Service) GetBindsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Bind], error)
- func (s *Service) GetCertificates(parameters connection.APIRequestParameters) ([]Certificate, error)
- func (s *Service) GetCertificatesPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Certificate], error)
- func (s *Service) GetCluster(clusterID int) (Cluster, error)
- func (s *Service) GetClusterACLTemplates(clusterID int) (ACLTemplates, error)
- func (s *Service) GetClusters(parameters connection.APIRequestParameters) ([]Cluster, error)
- func (s *Service) GetClustersPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Cluster], error)
- func (s *Service) GetDeployment(deploymentID int) (Deployment, error)
- func (s *Service) GetDeployments(parameters connection.APIRequestParameters) ([]Deployment, error)
- func (s *Service) GetDeploymentsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Deployment], error)
- func (s *Service) GetListener(listenerID int) (Listener, error)
- func (s *Service) GetListenerACLs(listenerID int, parameters connection.APIRequestParameters) ([]ACL, error)
- func (s *Service) GetListenerACLsPaginated(listenerID int, parameters connection.APIRequestParameters) (*connection.Paginated[ACL], error)
- func (s *Service) GetListenerAccessIP(listenerID int, accessID int) (AccessIP, error)
- func (s *Service) GetListenerAccessIPs(listenerID int, parameters connection.APIRequestParameters) ([]AccessIP, error)
- func (s *Service) GetListenerAccessIPsPaginated(listenerID int, parameters connection.APIRequestParameters) (*connection.Paginated[AccessIP], error)
- func (s *Service) GetListenerBind(listenerID int, bindID int) (Bind, error)
- func (s *Service) GetListenerBinds(listenerID int, parameters connection.APIRequestParameters) ([]Bind, error)
- func (s *Service) GetListenerBindsPaginated(listenerID int, parameters connection.APIRequestParameters) (*connection.Paginated[Bind], error)
- func (s *Service) GetListenerCertificate(listenerID int, certificateID int) (Certificate, error)
- func (s *Service) GetListenerCertificates(listenerID int, parameters connection.APIRequestParameters) ([]Certificate, error)
- func (s *Service) GetListenerCertificatesPaginated(listenerID int, parameters connection.APIRequestParameters) (*connection.Paginated[Certificate], error)
- func (s *Service) GetListeners(parameters connection.APIRequestParameters) ([]Listener, error)
- func (s *Service) GetListenersPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Listener], error)
- func (s *Service) GetTargetGroup(groupID int) (TargetGroup, error)
- func (s *Service) GetTargetGroupACLs(targetGroupID int, parameters connection.APIRequestParameters) ([]ACL, error)
- func (s *Service) GetTargetGroupACLsPaginated(targetGroupID int, parameters connection.APIRequestParameters) (*connection.Paginated[ACL], error)
- func (s *Service) GetTargetGroupTarget(groupID int, targetID int) (Target, error)
- func (s *Service) GetTargetGroupTargets(groupID int, parameters connection.APIRequestParameters) ([]Target, error)
- func (s *Service) GetTargetGroupTargetsPaginated(groupID int, parameters connection.APIRequestParameters) (*connection.Paginated[Target], error)
- func (s *Service) GetTargetGroups(parameters connection.APIRequestParameters) ([]TargetGroup, error)
- func (s *Service) GetTargetGroupsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[TargetGroup], error)
- func (s *Service) GetVIP(vipID int) (VIP, error)
- func (s *Service) GetVIPs(parameters connection.APIRequestParameters) ([]VIP, error)
- func (s *Service) GetVIPsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[VIP], error)
- func (s *Service) PatchACL(aclID int, req PatchACLRequest) error
- func (s *Service) PatchAccessIP(accessID int, req PatchAccessIPRequest) error
- func (s *Service) PatchCluster(clusterID int, req PatchClusterRequest) error
- func (s *Service) PatchListener(listenerID int, req PatchListenerRequest) error
- func (s *Service) PatchListenerBind(listenerID int, bindID int, req PatchBindRequest) error
- func (s *Service) PatchListenerCertificate(listenerID int, certificateID int, req PatchCertificateRequest) error
- func (s *Service) PatchTargetGroup(groupID int, req PatchTargetGroupRequest) error
- func (s *Service) PatchTargetGroupTarget(groupID int, targetID int, req PatchTargetRequest) error
- func (s *Service) ValidateCluster(clusterID int) error
- type Target
- type TargetGroup
- type TargetGroupBalance
- type TargetGroupMonitorMethod
- type TargetGroupNotFoundError
- type TargetNotFoundError
- type VIP
- type VIPNotFoundError
Constants ¶
This section is empty.
Variables ¶
var ListenerGeoIPRestrictionEnum connection.Enum[ListenerGeoIPRestriction] = []ListenerGeoIPRestriction{ ListenerGeoIPRestrictionAllow, ListenerGeoIPRestrictionDeny, }
var ModeEnum connection.Enum[Mode] = []Mode{ ModeHTTP, ModeTCP, }
var TargetGroupBalanceEnum connection.Enum[TargetGroupBalance] = []TargetGroupBalance{ TargetGroupBalanceRoundRobin, TargetGroupBalanceStaticRR, TargetGroupBalanceLeastConn, TargetGroupBalanceFirst, TargetGroupBalanceRDPCookie, TargetGroupBalanceURI, TargetGroupBalanceHDR, TargetGroupBalanceURLParam, TargetGroupBalanceSource, }
var TargetGroupMonitorMethodEnum connection.Enum[TargetGroupMonitorMethod] = []TargetGroupMonitorMethod{ TargetGroupMonitorMethodGET, TargetGroupMonitorMethodHEAD, TargetGroupMonitorMethodOPTIONS, }
Functions ¶
This section is empty.
Types ¶
type ACL ¶
type ACL struct {
ID int `json:"id"`
Name string `json:"name"`
ListenerID int `json:"listener_id"`
TargetGroupID int `json:"target_group_id"`
Conditions []ACLCondition `json:"conditions"`
Actions []ACLAction `json:"actions"`
}
ACL represents an ACL
type ACLAction ¶
type ACLAction struct {
Name string `json:"name"`
Arguments map[string]ACLArgument `json:"arguments"`
}
ACLAction represents an ACL action
type ACLArgument ¶
type ACLArgument struct {
Name string `json:"name"`
Value interface{} `json:"value"`
}
ACLArgument represents an ACL condition/action argument
type ACLCondition ¶
type ACLCondition struct {
Name string `json:"name"`
Inverted bool `json:"inverted"`
Arguments map[string]ACLArgument `json:"arguments"`
}
ACLCondition represents an ACL condition
type ACLNotFoundError ¶
type ACLNotFoundError struct {
ID int
}
ACLNotFoundError indicates a certificate was not found
func (*ACLNotFoundError) Error ¶
func (e *ACLNotFoundError) Error() string
type ACLTemplateAction ¶
type ACLTemplateAction struct {
Name string `json:"name"`
FriendlyName string `json:"friendly_name"`
Description string `json:"description"`
Arguments []ACLTemplateArgument `json:"arguments"`
}
type ACLTemplateArgument ¶ added in v1.9.0
type ACLTemplateCondition ¶
type ACLTemplateCondition struct {
Name string `json:"name"`
FriendlyName string `json:"friendly_name"`
Description string `json:"description"`
Arguments []ACLTemplateArgument `json:"arguments"`
}
type ACLTemplates ¶
type ACLTemplates struct {
Conditions []ACLTemplateCondition `json:"conditions"`
Actions []ACLTemplateAction `json:"actions"`
}
ACLTemplates represents a collection of ACL condition/action templates
type AccessIP ¶
type AccessIP struct {
ID int `json:"id"`
IP connection.IPAddress `json:"ip"`
CreatedAt connection.DateTime `json:"created_at"`
UpdatedAt connection.DateTime `json:"updated_at"`
}
AccessIP represents an access IP
type AccessIPNotFoundError ¶
type AccessIPNotFoundError struct {
ID int
}
AccessIPNotFoundError indicates an access IP was not found
func (*AccessIPNotFoundError) Error ¶
func (e *AccessIPNotFoundError) Error() string
type Bind ¶
type Bind struct {
ID int `json:"id"`
ListenerID int `json:"listener_id"`
VIPID int `json:"vip_id"`
Port int `json:"port"`
CreatedAt connection.DateTime `json:"created_at"`
UpdatedAt connection.DateTime `json:"updated_at"`
}
Bind represents a bind
type BindNotFoundError ¶
type BindNotFoundError struct {
ID int
}
BindNotFoundError indicates a bind was not found
func (*BindNotFoundError) Error ¶
func (e *BindNotFoundError) Error() string
type Certificate ¶
type Certificate struct {
ID int `json:"id"`
ListenerID int `json:"listener_id"`
Name string `json:"name"`
ExpiresAt connection.DateTime `json:"expires_at"`
CreatedAt connection.DateTime `json:"created_at"`
UpdatedAt connection.DateTime `json:"updated_at"`
}
Certificate represents a certificate
type CertificateNotFoundError ¶
type CertificateNotFoundError struct {
ID int
}
CertificateNotFoundError indicates a certificate was not found
func (*CertificateNotFoundError) Error ¶
func (e *CertificateNotFoundError) Error() string
type Cluster ¶
type Cluster struct {
ID int `json:"id"`
Name string `json:"name"`
Deployed bool `json:"deployed"`
DeployedAt connection.DateTime `json:"deployed_at"`
CreatedAt connection.DateTime `json:"created_at"`
UpdatedAt connection.DateTime `json:"updated_at"`
}
Cluster represents a cluster
type ClusterNotFoundError ¶
type ClusterNotFoundError struct {
ID int
}
ClusterNotFoundError indicates a cluster was not found
func (*ClusterNotFoundError) Error ¶
func (e *ClusterNotFoundError) Error() string
type CreateACLRequest ¶
type CreateACLRequest struct {
Name string `json:"name"`
Priority int `json:"priority,omitempty"`
ListenerID int `json:"listener_id,omitempty"`
TargetGroupID int `json:"target_group_id,omitempty"`
Conditions []ACLCondition `json:"conditions,omitempty"`
Actions []ACLAction `json:"actions"`
}
CreateACLRequest represents a request to create a ACL
type CreateAccessIPRequest ¶
type CreateAccessIPRequest struct {
IP connection.IPAddress `json:"ip"`
}
CreateAccessIPRequest represents a request to create an access IP
type CreateBindRequest ¶
CreateBindRequest represents a request to create a bind
type CreateCertificateRequest ¶
type CreateCertificateRequest struct {
Name string `json:"name"`
Key string `json:"key"`
Certificate string `json:"certificate"`
CABundle string `json:"ca_bundle"`
}
CreateCertificateRequest represents a request to create a certificate
type CreateListenerRequest ¶
type CreateListenerRequest struct {
Name string `json:"name"`
ClusterID int `json:"cluster_id"`
HSTSEnabled bool `json:"hsts_enabled"`
Mode Mode `json:"mode"`
HSTSMaxAge int `json:"hsts_maxage"`
Close bool `json:"close"`
RedirectHTTPS bool `json:"redirect_https"`
DefaultTargetGroupID int `json:"default_target_group_id"`
AccessIsAllowList bool `json:"access_is_allow_list"`
AllowTLSV1 bool `json:"allow_tlsv1"`
AllowTLSV11 bool `json:"allow_tlsv11"`
DisableTLSV12 bool `json:"disable_tlsv12"`
DisableHTTP2 bool `json:"disable_http2"`
HTTP2Only bool `json:"http2_only"`
CustomCiphers string `json:"custom_ciphers"`
CustomOptions string `json:"custom_options,omitempty"`
GeoIP *ListenerGeoIPRequest `json:"geoip,omitempty"`
TimeoutsClient int `json:"timeouts_client,omitempty"`
}
CreateListenerRequest represents a request to create a listener
type CreateTargetGroupRequest ¶
type CreateTargetGroupRequest struct {
ClusterID int `json:"cluster_id"`
Name string `json:"name"`
Balance TargetGroupBalance `json:"balance"`
Mode Mode `json:"mode"`
Close bool `json:"close"`
Sticky bool `json:"sticky"`
CookieOpts string `json:"cookie_opts,omitempty"`
Source string `json:"source,omitempty"`
TimeoutsConnect int `json:"timeouts_connect,omitempty"`
TimeoutsServer int `json:"timeouts_server,omitempty"`
TimeoutsHTTPRequest int `json:"timeouts_http_request,omitempty"`
TimeoutsCheck int `json:"timeouts_check,omitempty"`
TimeoutsTunnel int `json:"timeouts_tunnel,omitempty"`
CustomOptions string `json:"custom_options,omitempty"`
MonitorURL string `json:"monitor_url,omitempty"`
MonitorMethod TargetGroupMonitorMethod `json:"monitor_method,omitempty"`
MonitorHost string `json:"monitor_host,omitempty"`
MonitorHTTPVersion string `json:"monitor_http_version,omitempty"`
MonitorExpect string `json:"monitor_expect,omitempty"`
MonitorExpectString string `json:"monitor_expect_string,omitempty"`
MonitorExpectStringRegex bool `json:"monitor_expect_string_regex"`
MonitorTCPMonitoring bool `json:"monitor_tcp_monitoring"`
CheckPort int `json:"check_port,omitempty"`
SendProxy bool `json:"send_proxy"`
SendProxyV2 bool `json:"send_proxy_v2"`
SSL bool `json:"ssl"`
SSLVerify bool `json:"ssl_verify"`
SNI bool `json:"sni"`
}
CreateTargetGroupRequest represents a request to create a target group
type CreateTargetRequest ¶
type CreateTargetRequest struct {
Name string `json:"name,omitempty"`
IP connection.IPAddress `json:"ip"`
Port int `json:"port,omitempty"`
Weight int `json:"weight,omitempty"`
Backup bool `json:"backup"`
CheckInterval int `json:"check_interval,omitempty"`
CheckSSL bool `json:"check_ssl"`
CheckRise int `json:"check_rise,omitempty"`
CheckFall int `json:"check_fall,omitempty"`
DisableHTTP2 bool `json:"disable_http2"`
HTTP2Only bool `json:"http2_only"`
Active bool `json:"active"`
SessionCookieValue string `json:"session_cookie_value,omitempty"`
}
CreateTargetRequest represents a request to create a target
type CreateVIPRequest ¶
type CreateVIPRequest struct {
ClusterID int `json:"cluster_id"`
Type string `json:"type"`
CIDR string `json:"cidr"`
}
CreateVIPRequest represents a request to create a target group
type Deployment ¶ added in v1.12.0
type Deployment struct {
ID int `json:"id"`
ClusterID int `json:"cluster_id"`
Successful bool `json:"successful"`
RequestedByType string `json:"requested_by_type"`
RequestedByID string `json:"requested_by_id"`
PSSID int `json:"pss_id"`
CreatedAt connection.DateTime `json:"created_at"`
UpdatedAt connection.DateTime `json:"updated_at"`
}
Deployment represents a load balancer deployment
type DeploymentNotFoundError ¶ added in v1.12.0
type DeploymentNotFoundError struct {
ID int
}
DeploymentNotFoundError indicates a deployment was not found
func (*DeploymentNotFoundError) Error ¶ added in v1.12.0
func (e *DeploymentNotFoundError) Error() string
type Listener ¶
type Listener struct {
ID int `json:"id"`
Name string `json:"name"`
ClusterID int `json:"cluster_id"`
HSTSEnabled bool `json:"hsts_enabled"`
Mode Mode `json:"mode"`
HSTSMaxAge int `json:"hsts_maxage"`
Close bool `json:"close"`
RedirectHTTPS bool `json:"redirect_https"`
DefaultTargetGroupID int `json:"default_target_group_id"`
AccessIsAllowList bool `json:"access_is_allow_list"`
AllowTLSV1 bool `json:"allow_tlsv1"`
AllowTLSV11 bool `json:"allow_tlsv11"`
DisableTLSV12 bool `json:"disable_tlsv12"`
DisableHTTP2 bool `json:"disable_http2"`
HTTP2Only bool `json:"http2_only"`
CustomCiphers string `json:"custom_ciphers"`
CustomOptions string `json:"custom_options"`
TimeoutsClient int `json:"timeouts_client"`
GeoIP *ListenerGeoIP `json:"geoip"`
CreatedAt connection.DateTime `json:"created_at"`
UpdatedAt connection.DateTime `json:"updated_at"`
}
Listener represents a listener / frontend
type ListenerGeoIP ¶ added in v1.12.0
type ListenerGeoIP struct {
Restriction ListenerGeoIPRestriction `json:"restriction"`
Continents []string `json:"continents"`
Countries []string `json:"countries"`
EuropeanUnion bool `json:"european_union"`
}
type ListenerGeoIPRequest ¶ added in v1.13.0
type ListenerGeoIPRequest struct {
Restriction ListenerGeoIPRestriction `json:"restriction,omitempty"`
Continents []string `json:"continents,omitempty"`
Countries []string `json:"countries,omitempty"`
EuropeanUnion *bool `json:"european_union,omitempty"`
}
type ListenerGeoIPRestriction ¶ added in v1.12.0
type ListenerGeoIPRestriction string
const ( ListenerGeoIPRestrictionAllow ListenerGeoIPRestriction = "allow" ListenerGeoIPRestrictionDeny ListenerGeoIPRestriction = "deny" )
func (ListenerGeoIPRestriction) String ¶ added in v1.12.0
func (s ListenerGeoIPRestriction) String() string
type ListenerNotFoundError ¶
type ListenerNotFoundError struct {
ID int
}
ListenerNotFoundError indicates a listener was not found
func (*ListenerNotFoundError) Error ¶
func (e *ListenerNotFoundError) Error() string
type LoadBalancerService ¶
type LoadBalancerService interface {
// Cluster
GetClusters(parameters connection.APIRequestParameters) ([]Cluster, error)
GetClustersPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Cluster], error)
GetCluster(clusterID int) (Cluster, error)
PatchCluster(clusterID int, req PatchClusterRequest) error
DeployCluster(clusterID int) error
ValidateCluster(clusterID int) error
// Deployment
GetDeployments(parameters connection.APIRequestParameters) ([]Deployment, error)
GetDeploymentsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Deployment], error)
GetDeployment(deploymentID int) (Deployment, error)
// Cluster ACL Templates
GetClusterACLTemplates(clusterID int) (ACLTemplates, error)
// Target Group
GetTargetGroups(parameters connection.APIRequestParameters) ([]TargetGroup, error)
GetTargetGroupsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[TargetGroup], error)
GetTargetGroup(groupID int) (TargetGroup, error)
CreateTargetGroup(req CreateTargetGroupRequest) (int, error)
PatchTargetGroup(groupID int, req PatchTargetGroupRequest) error
DeleteTargetGroup(groupID int) error
// Target Group ACL
GetTargetGroupACLs(targetGroupID int, parameters connection.APIRequestParameters) ([]ACL, error)
GetTargetGroupACLsPaginated(targetGroupID int, parameters connection.APIRequestParameters) (*connection.Paginated[ACL], error)
// Target Group Target
GetTargetGroupTargets(groupID int, parameters connection.APIRequestParameters) ([]Target, error)
GetTargetGroupTargetsPaginated(groupID int, parameters connection.APIRequestParameters) (*connection.Paginated[Target], error)
GetTargetGroupTarget(groupID int, targetID int) (Target, error)
CreateTargetGroupTarget(groupID int, req CreateTargetRequest) (int, error)
PatchTargetGroupTarget(groupID int, targetID int, req PatchTargetRequest) error
DeleteTargetGroupTarget(groupID int, targetID int) error
// VIP
GetVIPs(parameters connection.APIRequestParameters) ([]VIP, error)
GetVIPsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[VIP], error)
GetVIP(vipID int) (VIP, error)
// Listener
GetListeners(parameters connection.APIRequestParameters) ([]Listener, error)
GetListenersPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Listener], error)
GetListener(listenerID int) (Listener, error)
CreateListener(req CreateListenerRequest) (int, error)
PatchListener(listenerID int, req PatchListenerRequest) error
DisableListenerGeoIP(listenerID int) error
DeleteListener(listenerID int) error
// Listener ACL
GetListenerACLs(listenerID int, parameters connection.APIRequestParameters) ([]ACL, error)
GetListenerACLsPaginated(listenerID int, parameters connection.APIRequestParameters) (*connection.Paginated[ACL], error)
// Listener Access IP
GetListenerAccessIPs(listenerID int, parameters connection.APIRequestParameters) ([]AccessIP, error)
GetListenerAccessIPsPaginated(listenerID int, parameters connection.APIRequestParameters) (*connection.Paginated[AccessIP], error)
CreateListenerAccessIP(listenerID int, req CreateAccessIPRequest) (int, error)
// Listener Bind
GetListenerBinds(listenerID int, parameters connection.APIRequestParameters) ([]Bind, error)
GetListenerBindsPaginated(listenerID int, parameters connection.APIRequestParameters) (*connection.Paginated[Bind], error)
GetListenerBind(listenerID int, bindID int) (Bind, error)
CreateListenerBind(listenerID int, req CreateBindRequest) (int, error)
PatchListenerBind(listenerID int, bindID int, req PatchBindRequest) error
DeleteListenerBind(listenerID int, bindID int) error
// Access IP
GetAccessIP(accessIP int) (AccessIP, error)
PatchAccessIP(accessIP int, req PatchAccessIPRequest) error
DeleteAccessIP(accessIP int) error
// Certificate
GetCertificates(parameters connection.APIRequestParameters) ([]Certificate, error)
GetCertificatesPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Certificate], error)
// Listener Certificate
GetListenerCertificates(listenerID int, parameters connection.APIRequestParameters) ([]Certificate, error)
GetListenerCertificatesPaginated(listenerID int, parameters connection.APIRequestParameters) (*connection.Paginated[Certificate], error)
GetListenerCertificate(listenerID int, certificateID int) (Certificate, error)
CreateListenerCertificate(listenerID int, req CreateCertificateRequest) (int, error)
PatchListenerCertificate(listenerID int, certificateID int, req PatchCertificateRequest) error
DeleteListenerCertificate(listenerID int, certificateID int) error
// Bind
GetBinds(parameters connection.APIRequestParameters) ([]Bind, error)
GetBindsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Bind], error)
// ACL
GetACLs(parameters connection.APIRequestParameters) ([]ACL, error)
GetACLsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[ACL], error)
GetACL(aclID int) (ACL, error)
CreateACL(req CreateACLRequest) (int, error)
PatchACL(aclID int, req PatchACLRequest) error
DeleteACL(aclID int) error
}
LoadBalancerService is an interface for managing the LoadBalancer service
type PatchACLRequest ¶
type PatchACLRequest struct {
Name string `json:"name,omitempty"`
Priority int `json:"priority,omitempty"`
Conditions []ACLCondition `json:"conditions,omitempty"`
Actions []ACLAction `json:"actions,omitempty"`
}
PatchListenerACLRequest represents a request to patch a ACL
type PatchAccessIPRequest ¶
type PatchAccessIPRequest struct {
IP connection.IPAddress `json:"ip,omitempty"`
}
PatchAccessIPRequest represents a request to patch an access IP
type PatchBindRequest ¶
type PatchBindRequest struct {
VIPID int `json:"vip_id,omitempty"`
Port int `json:"port,omitempty"`
}
PatchBindRequest represents a request to patch a bind
type PatchCertificateRequest ¶
type PatchCertificateRequest struct {
Name string `json:"name,omitempty"`
Key string `json:"key,omitempty"`
Certificate string `json:"certificate,omitempty"`
CABundle string `json:"ca_bundle,omitempty"`
}
PatchListenerCertificateRequest represents a request to patch a certificate
type PatchClusterRequest ¶
type PatchClusterRequest struct {
Name string `json:"name,omitempty"`
}
PatchClusterRequest represents a request to patch a cluster
type PatchListenerRequest ¶
type PatchListenerRequest struct {
Name string `json:"name,omitempty"`
HSTSEnabled *bool `json:"hsts_enabled,omitempty"`
Mode Mode `json:"mode,omitempty"`
HSTSMaxAge int `json:"hsts_maxage,omitempty"`
Close *bool `json:"close,omitempty"`
RedirectHTTPS *bool `json:"redirect_https,omitempty"`
DefaultTargetGroupID int `json:"default_target_group_id,omitempty"`
AccessIsAllowList *bool `json:"access_is_allow_list,omitempty"`
AllowTLSV1 *bool `json:"allow_tlsv1,omitempty"`
AllowTLSV11 *bool `json:"allow_tlsv11,omitempty"`
DisableTLSV12 *bool `json:"disable_tlsv12,omitempty"`
DisableHTTP2 *bool `json:"disable_http2,omitempty"`
HTTP2Only *bool `json:"http2_only,omitempty"`
CustomCiphers string `json:"custom_ciphers,omitempty"`
CustomOptions string `json:"custom_options,omitempty"`
GeoIP *ListenerGeoIPRequest `json:"geoip,omitempty"`
TimeoutsClient int `json:"timeouts_client,omitempty"`
}
PatchListenerRequest represents a request to patch a listener
type PatchTargetGroupRequest ¶
type PatchTargetGroupRequest struct {
Name string `json:"name,omitempty"`
Balance TargetGroupBalance `json:"balance,omitempty"`
Mode Mode `json:"mode,omitempty"`
Close *bool `json:"close,omitempty"`
Sticky *bool `json:"sticky,omitempty"`
CookieOpts string `json:"cookie_opts,omitempty"`
Source string `json:"source,omitempty"`
TimeoutsConnect int `json:"timeouts_connect,omitempty"`
TimeoutsServer int `json:"timeouts_server,omitempty"`
TimeoutsHTTPRequest int `json:"timeouts_http_request,omitempty"`
TimeoutsCheck int `json:"timeouts_check,omitempty"`
TimeoutsTunnel int `json:"timeouts_tunnel,omitempty"`
CustomOptions string `json:"custom_options,omitempty"`
MonitorURL string `json:"monitor_url,omitempty"`
MonitorMethod TargetGroupMonitorMethod `json:"monitor_method,omitempty"`
MonitorHost string `json:"monitor_host,omitempty"`
MonitorHTTPVersion string `json:"monitor_http_version,omitempty"`
MonitorExpect string `json:"monitor_expect,omitempty"`
MonitorExpectString string `json:"monitor_expect_string,omitempty"`
MonitorExpectStringRegex *bool `json:"monitor_expect_string_regex,omitempty"`
MonitorTCPMonitoring *bool `json:"monitor_tcp_monitoring,omitempty"`
CheckPort int `json:"check_port,omitempty"`
SendProxy *bool `json:"send_proxy,omitempty"`
SendProxyV2 *bool `json:"send_proxy_v2,omitempty"`
SSL *bool `json:"ssl,omitempty"`
SSLVerify *bool `json:"ssl_verify,omitempty"`
SNI *bool `json:"sni,omitempty"`
}
PatchTargetGroupRequest represents a request to patch a target group
type PatchTargetRequest ¶
type PatchTargetRequest struct {
Name string `json:"name,omitempty"`
IP connection.IPAddress `json:"ip,omitempty"`
Port int `json:"port,omitempty"`
Weight int `json:"weight,omitempty"`
Backup *bool `json:"backup,omitempty"`
CheckInterval int `json:"check_interval,omitempty"`
CheckSSL *bool `json:"check_ssl,omitempty"`
CheckRise int `json:"check_rise,omitempty"`
CheckFall int `json:"check_fall,omitempty"`
DisableHTTP2 *bool `json:"disable_http2,omitempty"`
HTTP2Only *bool `json:"http2_only,omitempty"`
Active *bool `json:"active,omitempty"`
SessionCookieValue string `json:"session_cookie_value,omitempty"`
}
PatchTargetRequest represents a request to patch a target
type PatchVIPRequest ¶
type PatchVIPRequest struct {
Type string `json:"type,omitempty"`
CIDR string `json:"cidr,omitempty"`
}
PatchVIPRequest represents a request to patch a target group
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements LoadBalancerService for managing LoadBalancer certificates via the UKFast API
func NewService ¶
func NewService(connection connection.Connection) *Service
NewService returns a new instance of LoadBalancerService
func (*Service) CreateACL ¶
func (s *Service) CreateACL(req CreateACLRequest) (int, error)
CreateACL creates an ACL
func (*Service) CreateListener ¶
func (s *Service) CreateListener(req CreateListenerRequest) (int, error)
CreateListener creates a listener
func (*Service) CreateListenerAccessIP ¶
func (s *Service) CreateListenerAccessIP(listenerID int, req CreateAccessIPRequest) (int, error)
CreateListenerAccessIP creates an access IP
func (*Service) CreateListenerBind ¶
func (s *Service) CreateListenerBind(listenerID int, req CreateBindRequest) (int, error)
CreateListenerBind creates an bind
func (*Service) CreateListenerCertificate ¶
func (s *Service) CreateListenerCertificate(listenerID int, req CreateCertificateRequest) (int, error)
CreateListenerCertificate creates an certificate
func (*Service) CreateTargetGroup ¶
func (s *Service) CreateTargetGroup(req CreateTargetGroupRequest) (int, error)
CreateTargetGroup creates a target group
func (*Service) CreateTargetGroupTarget ¶
func (s *Service) CreateTargetGroupTarget(groupID int, req CreateTargetRequest) (int, error)
CreateTargetGroupTarget creates a target
func (*Service) DeleteAccessIP ¶
DeleteAccessIP deletes an access IP
func (*Service) DeleteListener ¶
DeleteListener deletes a listener
func (*Service) DeleteListenerBind ¶
DeleteListenerBind deletes a bind
func (*Service) DeleteListenerCertificate ¶
DeleteListenerCertificate deletes a certificate
func (*Service) DeleteTargetGroup ¶
DeleteTargetGroup deletes a target group
func (*Service) DeleteTargetGroupTarget ¶
DeleteTargetGroupTarget deletes a target
func (*Service) DeployCluster ¶
DeployCluster deploys a Cluster
func (*Service) DisableListenerGeoIP ¶ added in v1.13.0
DisableListenerGeoIP patches a listener
func (*Service) GetACLs ¶
func (s *Service) GetACLs(parameters connection.APIRequestParameters) ([]ACL, error)
GetACLs retrieves a list of ACLs Currently, a target_group_id or listener_id filter must be provided for this to return data
func (*Service) GetACLsPaginated ¶
func (s *Service) GetACLsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[ACL], error)
GetACLsPaginated retrieves a paginated list of ACLs Currently, a target_group_id or listener_id filter must be provided for this to return data
func (*Service) GetAccessIP ¶
GetAccessIP retrieves a single access IP by id
func (*Service) GetBinds ¶
func (s *Service) GetBinds(parameters connection.APIRequestParameters) ([]Bind, error)
GetBinds retrieves a list of binds
func (*Service) GetBindsPaginated ¶
func (s *Service) GetBindsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Bind], error)
GetBindsPaginated retrieves a paginated list of binds
func (*Service) GetCertificates ¶ added in v1.11.0
func (s *Service) GetCertificates(parameters connection.APIRequestParameters) ([]Certificate, error)
GetCertificates retrieves a list of certificates
func (*Service) GetCertificatesPaginated ¶ added in v1.11.0
func (s *Service) GetCertificatesPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Certificate], error)
GetCertificatesPaginated retrieves a paginated list of certificates
func (*Service) GetCluster ¶
GetCluster retrieves a single cluster by id
func (*Service) GetClusterACLTemplates ¶
func (s *Service) GetClusterACLTemplates(clusterID int) (ACLTemplates, error)
GetClusterACLTemplates retrieves a single cluster by id
func (*Service) GetClusters ¶
func (s *Service) GetClusters(parameters connection.APIRequestParameters) ([]Cluster, error)
GetClusters retrieves a list of clusters
func (*Service) GetClustersPaginated ¶
func (s *Service) GetClustersPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Cluster], error)
GetClustersPaginated retrieves a paginated list of clusters
func (*Service) GetDeployment ¶ added in v1.12.0
func (s *Service) GetDeployment(deploymentID int) (Deployment, error)
GetDeployment retrieves a single deployment by id
func (*Service) GetDeployments ¶ added in v1.12.0
func (s *Service) GetDeployments(parameters connection.APIRequestParameters) ([]Deployment, error)
GetDeployments retrieves a list of deployments
func (*Service) GetDeploymentsPaginated ¶ added in v1.12.0
func (s *Service) GetDeploymentsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Deployment], error)
GetDeploymentsPaginated retrieves a paginated list of deployments
func (*Service) GetListener ¶
GetListener retrieves a single listener by id
func (*Service) GetListenerACLs ¶
func (s *Service) GetListenerACLs(listenerID int, parameters connection.APIRequestParameters) ([]ACL, error)
GetListenerACLs retrieves a list of ACLs
func (*Service) GetListenerACLsPaginated ¶
func (s *Service) GetListenerACLsPaginated(listenerID int, parameters connection.APIRequestParameters) (*connection.Paginated[ACL], error)
GetListenerACLsPaginated retrieves a paginated list of ACLs
func (*Service) GetListenerAccessIP ¶
GetListenerAccessIP retrieves a single access IP by id
func (*Service) GetListenerAccessIPs ¶
func (s *Service) GetListenerAccessIPs(listenerID int, parameters connection.APIRequestParameters) ([]AccessIP, error)
GetListenerAccessIPs retrieves a list of access IPs
func (*Service) GetListenerAccessIPsPaginated ¶
func (s *Service) GetListenerAccessIPsPaginated(listenerID int, parameters connection.APIRequestParameters) (*connection.Paginated[AccessIP], error)
GetListenerAccessIPsPaginated retrieves a paginated list of access IPs
func (*Service) GetListenerBind ¶
GetListenerBind retrieves a single bind by id
func (*Service) GetListenerBinds ¶
func (s *Service) GetListenerBinds(listenerID int, parameters connection.APIRequestParameters) ([]Bind, error)
GetListenerBinds retrieves a list of binds
func (*Service) GetListenerBindsPaginated ¶
func (s *Service) GetListenerBindsPaginated(listenerID int, parameters connection.APIRequestParameters) (*connection.Paginated[Bind], error)
GetListenerBindsPaginated retrieves a paginated list of binds
func (*Service) GetListenerCertificate ¶
func (s *Service) GetListenerCertificate(listenerID int, certificateID int) (Certificate, error)
GetListenerCertificate retrieves a single certificate by id
func (*Service) GetListenerCertificates ¶
func (s *Service) GetListenerCertificates(listenerID int, parameters connection.APIRequestParameters) ([]Certificate, error)
GetListenerCertificates retrieves a list of certificates
func (*Service) GetListenerCertificatesPaginated ¶
func (s *Service) GetListenerCertificatesPaginated(listenerID int, parameters connection.APIRequestParameters) (*connection.Paginated[Certificate], error)
GetListenerCertificatesPaginated retrieves a paginated list of certificates
func (*Service) GetListeners ¶
func (s *Service) GetListeners(parameters connection.APIRequestParameters) ([]Listener, error)
GetListeners retrieves a list of listeners
func (*Service) GetListenersPaginated ¶
func (s *Service) GetListenersPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Listener], error)
GetListenersPaginated retrieves a paginated list of listeners
func (*Service) GetTargetGroup ¶
func (s *Service) GetTargetGroup(groupID int) (TargetGroup, error)
GetTargetGroup retrieves a single target group by id
func (*Service) GetTargetGroupACLs ¶
func (s *Service) GetTargetGroupACLs(targetGroupID int, parameters connection.APIRequestParameters) ([]ACL, error)
GetTargetGroupACLs retrieves a list of ACLs
func (*Service) GetTargetGroupACLsPaginated ¶
func (s *Service) GetTargetGroupACLsPaginated(targetGroupID int, parameters connection.APIRequestParameters) (*connection.Paginated[ACL], error)
GetTargetGroupACLsPaginated retrieves a paginated list of ACLs
func (*Service) GetTargetGroupTarget ¶
GetTargetGroupTarget retrieves a single target by id
func (*Service) GetTargetGroupTargets ¶
func (s *Service) GetTargetGroupTargets(groupID int, parameters connection.APIRequestParameters) ([]Target, error)
GetTargetGroupTargets retrieves a list of targets
func (*Service) GetTargetGroupTargetsPaginated ¶
func (s *Service) GetTargetGroupTargetsPaginated(groupID int, parameters connection.APIRequestParameters) (*connection.Paginated[Target], error)
GetTargetGroupTargetsPaginated retrieves a paginated list of targets
func (*Service) GetTargetGroups ¶
func (s *Service) GetTargetGroups(parameters connection.APIRequestParameters) ([]TargetGroup, error)
GetTargetGroups retrieves a list of target groups
func (*Service) GetTargetGroupsPaginated ¶
func (s *Service) GetTargetGroupsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[TargetGroup], error)
GetTargetGroupsPaginated retrieves a paginated list of target groups
func (*Service) GetVIPs ¶
func (s *Service) GetVIPs(parameters connection.APIRequestParameters) ([]VIP, error)
GetVIPs retrieves a list of VIPs
func (*Service) GetVIPsPaginated ¶
func (s *Service) GetVIPsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[VIP], error)
GetVIPsPaginated retrieves a paginated list of VIPs
func (*Service) PatchACL ¶
func (s *Service) PatchACL(aclID int, req PatchACLRequest) error
PatchACL patches an ACL
func (*Service) PatchAccessIP ¶
func (s *Service) PatchAccessIP(accessID int, req PatchAccessIPRequest) error
PatchAccessIP patches an access IP
func (*Service) PatchCluster ¶
func (s *Service) PatchCluster(clusterID int, req PatchClusterRequest) error
PatchCluster patches a Cluster
func (*Service) PatchListener ¶
func (s *Service) PatchListener(listenerID int, req PatchListenerRequest) error
PatchListener patches a listener
func (*Service) PatchListenerBind ¶
func (s *Service) PatchListenerBind(listenerID int, bindID int, req PatchBindRequest) error
PatchListenerBind patches an bind
func (*Service) PatchListenerCertificate ¶
func (s *Service) PatchListenerCertificate(listenerID int, certificateID int, req PatchCertificateRequest) error
PatchListenerCertificate patches an certificate
func (*Service) PatchTargetGroup ¶
func (s *Service) PatchTargetGroup(groupID int, req PatchTargetGroupRequest) error
PatchTargetGroup patches a target group
func (*Service) PatchTargetGroupTarget ¶
func (s *Service) PatchTargetGroupTarget(groupID int, targetID int, req PatchTargetRequest) error
PatchTargetGroupTarget patches a target
func (*Service) ValidateCluster ¶
ValidateCluster validates a cluster
type Target ¶
type Target struct {
ID int `json:"id"`
TargetGroupID int `json:"target_group_id"`
Name string `json:"name"`
IP connection.IPAddress `json:"ip"`
Port int `json:"port"`
Weight int `json:"weight"`
Backup bool `json:"backup"`
CheckInterval int `json:"check_interval"`
CheckSSL bool `json:"check_ssl"`
CheckRise int `json:"check_rise"`
CheckFall int `json:"check_fall"`
DisableHTTP2 bool `json:"disable_http2"`
HTTP2Only bool `json:"http2_only"`
Active bool `json:"active"`
SessionCookieValue string `json:"session_cookie_value"`
CreatedAt connection.DateTime `json:"created_at"`
UpdatedAt connection.DateTime `json:"updated_at"`
}
Target represents a target
type TargetGroup ¶
type TargetGroup struct {
ID int `json:"id"`
ClusterID int `json:"cluster_id"`
Name string `json:"name"`
Balance TargetGroupBalance `json:"balance"`
Mode Mode `json:"mode"`
Close bool `json:"close"`
Sticky bool `json:"sticky"`
CookieOpts string `json:"cookie_opts"`
Source string `json:"source"`
TimeoutsConnect int `json:"timeouts_connect"`
TimeoutsServer int `json:"timeouts_server"`
TimeoutsHTTPRequest int `json:"timeouts_http_request"`
TimeoutsCheck int `json:"timeouts_check"`
TimeoutsTunnel int `json:"timeouts_tunnel"`
CustomOptions string `json:"custom_options"`
MonitorURL string `json:"monitor_url"`
MonitorMethod TargetGroupMonitorMethod `json:"monitor_method"`
MonitorHost string `json:"monitor_host"`
MonitorHTTPVersion string `json:"monitor_http_version"`
MonitorExpect string `json:"monitor_expect"`
MonitorExpectString string `json:"monitor_expect_string"`
MonitorExpectStringRegex bool `json:"monitor_expect_string_regex"`
MonitorTCPMonitoring bool `json:"monitor_tcp_monitoring"`
CheckPort int `json:"check_port"`
SendProxy bool `json:"send_proxy"`
SendProxyV2 bool `json:"send_proxy_v2"`
SSL bool `json:"ssl"`
SSLVerify bool `json:"ssl_verify"`
SNI bool `json:"sni"`
CreatedAt connection.DateTime `json:"created_at"`
UpdatedAt connection.DateTime `json:"updated_at"`
}
TargetGroup represents a target group
type TargetGroupBalance ¶
type TargetGroupBalance string
const ( TargetGroupBalanceRoundRobin TargetGroupBalance = "roundrobin" TargetGroupBalanceStaticRR TargetGroupBalance = "static-rr" TargetGroupBalanceLeastConn TargetGroupBalance = "leastconn" TargetGroupBalanceFirst TargetGroupBalance = "first" TargetGroupBalanceRDPCookie TargetGroupBalance = "rdp-cookie" TargetGroupBalanceURI TargetGroupBalance = "uri" TargetGroupBalanceHDR TargetGroupBalance = "hdr" TargetGroupBalanceURLParam TargetGroupBalance = "url_param" TargetGroupBalanceSource TargetGroupBalance = "source" )
func (TargetGroupBalance) String ¶
func (s TargetGroupBalance) String() string
type TargetGroupMonitorMethod ¶
type TargetGroupMonitorMethod string
const ( TargetGroupMonitorMethodGET TargetGroupMonitorMethod = "GET" TargetGroupMonitorMethodHEAD TargetGroupMonitorMethod = "HEAD" TargetGroupMonitorMethodOPTIONS TargetGroupMonitorMethod = "OPTIONS" )
func (TargetGroupMonitorMethod) String ¶
func (s TargetGroupMonitorMethod) String() string
type TargetGroupNotFoundError ¶
type TargetGroupNotFoundError struct {
ID int
}
TargetGroupNotFoundError indicates a target group was not found
func (*TargetGroupNotFoundError) Error ¶
func (e *TargetGroupNotFoundError) Error() string
type TargetNotFoundError ¶
type TargetNotFoundError struct {
ID int
}
TargetNotFoundError indicates a target was not found
func (*TargetNotFoundError) Error ¶
func (e *TargetNotFoundError) Error() string
type VIP ¶
type VIP struct {
ID int `json:"id"`
ClusterID int `json:"cluster_id"`
InternalCIDR string `json:"internal_cidr"`
ExternalCIDR string `json:"external_cidr"`
MACAddress string `json:"mac_address"`
CreatedAt connection.DateTime `json:"created_at"`
UpdatedAt connection.DateTime `json:"updated_at"`
}
VIP represents a target virtual IP address
type VIPNotFoundError ¶
type VIPNotFoundError struct {
ID int
}
VIPNotFoundError indicates a VIP was not found
func (*VIPNotFoundError) Error ¶
func (e *VIPNotFoundError) Error() string
Source Files
¶
- error.go
- model.go
- request.go
- service.go
- service_accessip.go
- service_acl.go
- service_bind.go
- service_certificate.go
- service_cluster.go
- service_deployment.go
- service_listener.go
- service_listener_accessip.go
- service_listener_acl.go
- service_listener_bind.go
- service_listener_certificate.go
- service_targetgroup.go
- service_targetgroup_acl.go
- service_targetgroup_target.go
- service_vip.go