Documentation
¶
Index ¶
- Constants
- func WatchServicesIndirectStartFunc(store Store, opts QueryServiceOptions, ...) daemon.StartFunc
- func WatchServicesStartFunc(store Store, opts QueryServiceOptions, updates chan<- ServiceUpdate) daemon.StartFunc
- type Cluster
- type ContainerRule
- type Host
- type HostChange
- type IngressInstance
- type Instance
- type Labeled
- type QueryServiceOptions
- type Selector
- type Service
- type ServiceChange
- type ServiceInfo
- type ServiceUpdate
- type Store
Constants ¶
View Source
const ( HostLabel = "host" StateLabel = "state" RuleLabel = "rule" )
Variables ¶
This section is empty.
Functions ¶
func WatchServicesIndirectStartFunc ¶
func WatchServicesIndirectStartFunc(store Store, opts QueryServiceOptions, cb func(update ServiceUpdate, stop <-chan struct{})) daemon.StartFunc
func WatchServicesStartFunc ¶
func WatchServicesStartFunc(store Store, opts QueryServiceOptions, updates chan<- ServiceUpdate) daemon.StartFunc
Types ¶
type ContainerRule ¶
type ContainerRule struct { Selector Selector `json:"selector,omitempty"` InstancePort int `json:"instancePort,omitempty"` }
Specifies how containers should be selected as instances, and the attributes of the resulting instances.
func (*ContainerRule) Includes ¶
func (spec *ContainerRule) Includes(s Labeled) bool
type HostChange ¶
type IngressInstance ¶
type IngressInstance struct {
Weight int `json:"weight"`
}
type Instance ¶
type QueryServiceOptions ¶
type ServiceChange ¶
type ServiceInfo ¶
type ServiceInfo struct { Service Instances map[string]Instance ContainerRules map[string]ContainerRule IngressInstances map[netutil.IPPort]IngressInstance }
type ServiceUpdate ¶
type ServiceUpdate struct { Services map[string]*ServiceInfo Reset bool }
type Store ¶
type Store interface { Cluster Ping() error RegisterHost(identity string, details *Host) error DeregisterHost(identity string) error GetHosts() ([]*Host, error) WatchHosts(ctx context.Context, resCh chan<- HostChange, errorSink daemon.ErrorSink) CheckRegisteredService(serviceName string) error AddService(name string, service Service) error RemoveService(serviceName string) error RemoveAllServices() error GetService(serviceName string, opts QueryServiceOptions) (*ServiceInfo, error) GetAllServices(opts QueryServiceOptions) (map[string]*ServiceInfo, error) SetContainerRule(serviceName string, ruleName string, spec ContainerRule) error RemoveContainerRule(serviceName string, ruleName string) error AddInstance(serviceName, instanceName string, details Instance) error RemoveInstance(serviceName, instanceName string) error AddIngressInstance(serviceName string, addr netutil.IPPort, details IngressInstance) error RemoveIngressInstance(serviceName string, addr netutil.IPPort) error WatchServices(ctx context.Context, resCh chan<- ServiceChange, errorSink daemon.ErrorSink, opts QueryServiceOptions) }
Click to show internal directories.
Click to hide internal directories.