Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // HTTP - HTTP HTTP = Protocol("HTTP") // HTTPS - HTTPS HTTPS = Protocol("HTTPS") // TCP - TCP TCP = Protocol("TCP") // SSL - SSL SSL = Protocol("SSL") // UDP - UDP UDP = Protocol("UDP") // Invalid - This is the 'nil' value Invalid = Protocol("") )
View Source
var InterfaceSpec = spi.InterfaceSpec{
Name: "L4",
Version: "0.6.1",
}
InterfaceSpec is the current name and version of the L4 API.
Functions ¶
This section is empty.
Types ¶
type HealthCheck ¶
type HealthCheck struct {
// BackendPort is the port on a backend node to probe
BackendPort int
// Healthy is the number of tries to succeed to be considered healthy
Healthy int
// Unhealthy is the number of tries to fail to be considered unhealthy
Unhealthy int
// Interval is the probe / ping interval
Interval time.Duration
// Timeout is the duration to wait before timing out.
Timeout time.Duration
}
HealthCheck models the a probe that checks against a given backend port at given intervals and with timeout.
type L4 ¶
type L4 interface {
// Name is the name of the load balancer
Name() string
// Routes lists all known routes.
Routes() ([]Route, error)
// Publish publishes a route in the LB by adding a load balancing rule
Publish(route Route) (Result, error)
// Unpublish dissociates the load balancer from the backend service at the given port.
Unpublish(extPort int) (Result, error)
// ConfigureHealthCheck configures the health checks for instance removal and reconfiguration
// The parameters healthy and unhealthy indicate the number of consecutive success or fail pings required to
// mark a backend instance as healthy or unhealthy. The ping occurs on the backendPort parameter and
// at the interval specified.
ConfigureHealthCheck(hc HealthCheck) (Result, error)
// RegisterBackend registers instances identified by the IDs to the LB's backend pool
RegisterBackends(ids []instance.ID) (Result, error)
// DeregisterBackend removes the specified instances from the backend pool
DeregisterBackends(id []instance.ID) (Result, error)
// Backends returns a list of backends
Backends() ([]instance.ID, error)
}
L4 is the generic driver for a single L4 load balancer instance
type Protocol ¶
type Protocol string
Protocol is a network protocol.
func ProtocolFromString ¶
ProtocolFromString gets the matching protocol for a string value.
func (Protocol) MarshalJSON ¶
MarshalJSON returns the json representation
func (*Protocol) UnmarshalJSON ¶
UnmarshalJSON unmarshals the buffer to this struct
type Route ¶
type Route struct {
// Port is the TCP port that the backend instance is listening on.
Port int
// Protocol is the network protocol that the backend instance is listening on.
Protocol Protocol
// LoadBalancerPort is the TCP port that the load balancer is listening on.
LoadBalancerPort int
// LoadBalancerProtocol is the network protocol that the load balancer is listening on.
LoadBalancerProtocol Protocol
// Certificate is the certificate used by the load balancer.
Certificate *string
}
Route is a description of a network target for a load balancer.
Click to show internal directories.
Click to hide internal directories.