Documentation ¶
Index ¶
- Constants
- func RegisterRouteHandler(key string, f func() (RouteHandler, error))
- func ResolveDependencies(spec types.Spec) (depends.Runnables, error)
- func TemplateFrom(source []byte) (*template.Template, error)
- type BackendSpec
- type Group
- type Options
- type Properties
- func (p Properties) Groups() (result map[Vhost][]Group, err error)
- func (p Properties) HealthChecks() (result map[Vhost][]loadbalancer.HealthCheck, err error)
- func (p Properties) InstanceIDs() (result map[Vhost][]instance.ID, err error)
- func (p Properties) L4Func(findL4 func(spec Spec) (loadbalancer.L4, error)) func() (map[Vhost]loadbalancer.L4, error)
- func (p Properties) Routes(options Options) (result map[Vhost][]loadbalancer.Route, err error)
- type RouteHandler
- type Spec
- type Vhost
Constants ¶
const ( // DefaultSyncInterval is the interval between syncing backends DefaultSyncInterval = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func RegisterRouteHandler ¶
func RegisterRouteHandler(key string, f func() (RouteHandler, error))
RegisterRouteHandler registers a package specific handler for determining the L4 routes (e.g. static or swarm)
func ResolveDependencies ¶
ResolveDependencies returns a list of dependencies by parsing the opaque Properties blob.
Types ¶
type BackendSpec ¶
type BackendSpec struct { // Groups are the ids of the groups managed by the group controller. // The plugin name is used ==> plugin name and type. type is the group id. Groups []Group // Instances are static instance ids Instances []instance.ID }
BackendSpec specifies the instances that are the backends. They can come from groups of a given group controller or speccific instance ids.
type Options ¶
type Options struct { // HardSync when set to true will remove entries already in the L4 that // may have been added by the user out of band. Default is false. HardSync bool // MatchByLabels figures out services by looking at swarm service labels. // This is normally OFF and instead we just look at publish and target ports. MatchByLabels bool // SyncInterval is how often to run the sync. The syntax is the string form // of Go time.Duration (e.g. 1min) SyncInterval types.Duration // SourceKeySelector is a string template for selecting the join key from // a source instance.Description. SourceKeySelector string }
Options is the controller options
type Properties ¶
type Properties []Spec
Properties is the properties for the ingress controller. This struct is used to parse the `Properties` field of a pkg/types/Spec.
func (Properties) Groups ¶
func (p Properties) Groups() (result map[Vhost][]Group, err error)
Groups returns a list of group ids by Vhost
func (Properties) HealthChecks ¶
func (p Properties) HealthChecks() (result map[Vhost][]loadbalancer.HealthCheck, err error)
HealthChecks returns a map of health checks by vhost
func (Properties) InstanceIDs ¶
func (p Properties) InstanceIDs() (result map[Vhost][]instance.ID, err error)
InstanceIDs returns a map of static instance ids by vhost
func (Properties) L4Func ¶
func (p Properties) L4Func(findL4 func(spec Spec) (loadbalancer.L4, error)) func() (map[Vhost]loadbalancer.L4, error)
L4Func returns a function that can return a map of vhost and L4 objects, with the help of plugin lookup.
func (Properties) Routes ¶
func (p Properties) Routes(options Options) (result map[Vhost][]loadbalancer.Route, err error)
Routes returns a map of routes by vhost. This will try to parse the Routes field of each Spec as loadbalancer.Route. If parsing fails, the provided function callback is used to provide alternative parsing of the types.Any to give the data.
type RouteHandler ¶
type RouteHandler interface { io.Closer // Routes returns a map of vhost and loadbalancer routes given the input blob Routes(*types.Any, Options) (map[Vhost][]loadbalancer.Route, error) }
RouteHandler is the interface that different modules must support
type Spec ¶
type Spec struct { // Vhost is the Vhost for the load balancer Vhost Vhost // L4Plugin is the name of the L4Plugin to lookup L4Plugin plugin.Name // RouteSources allows the specification of routes based on some specialized handlers. // The routes are keyed by the 'handler' name and the configuration blob are specific to the keyed // handler. For example, a 'swarm' handler will dynamically generate the required routes based // on Docker swarm services. These routes are added to the static routes. RouteSources map[string]*types.Any // Routes are those that are always synchronized routes that are specified in the configuration. Routes []loadbalancer.Route // Backends specify where to get the nodes of the backend pool. Backends BackendSpec // HealthChecks specify how to do health check against the backend services HealthChecks []loadbalancer.HealthCheck }
Spec provides a mapping of a vhost to