Documentation ¶
Index ¶
- type Client
- func (c *Client) Events() <-chan ServiceEvent
- func (c *Client) Instances(hostname string) []*Instance
- func (c *Client) InstancesByHost(hosts []string) []*Instance
- func (c *Client) Service(hostname string) *Service
- func (c *Client) Services() []*Service
- func (c *Client) Start() error
- func (c *Client) Stop()
- type Controller
- func (c *Controller) AppendInstanceHandler(f func(*model.ServiceInstance, model.Event)) error
- func (c *Controller) AppendServiceHandler(f func(*model.Service, model.Event)) error
- func (c *Controller) GetIstioServiceAccounts(hostname model.Hostname, ports []string) []string
- func (c *Controller) GetProxyServiceInstances(proxy *model.Proxy) ([]*model.ServiceInstance, error)
- func (c *Controller) GetService(hostname model.Hostname) (*model.Service, error)
- func (sd *Controller) GetServiceAttributes(hostname model.Hostname) (*model.ServiceAttributes, error)
- func (c *Controller) Instances(hostname model.Hostname, ports []string, labels model.LabelsCollection) ([]*model.ServiceInstance, error)
- func (c *Controller) InstancesByPort(hostname model.Hostname, port int, labels model.LabelsCollection) ([]*model.ServiceInstance, error)
- func (c *Controller) ManagementPorts(addr string) model.PortList
- func (c *Controller) Run(stop <-chan struct{})
- func (c *Controller) Services() ([]*model.Service, error)
- func (c *Controller) WorkloadHealthCheckInfo(addr string) model.ProbeList
- type Instance
- type Port
- type Service
- type ServiceEvent
- type ServiceEventType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Events ¶
func (c *Client) Events() <-chan ServiceEvent
Events channel is a stream of Service and instance updates
func (*Client) InstancesByHost ¶
Instances query service instances with labels
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller communicate with zookeeper.
func NewController ¶
func NewController(address string, root string) (*Controller, error)
NewController create a Controller instance
func (*Controller) AppendInstanceHandler ¶
func (c *Controller) AppendInstanceHandler(f func(*model.ServiceInstance, model.Event)) error
AppendInstanceHandler notifies about changes to the service instances for a service.
func (*Controller) AppendServiceHandler ¶
AppendServiceHandler notifies about changes to the service catalog.
func (*Controller) GetIstioServiceAccounts ¶
func (c *Controller) GetIstioServiceAccounts(hostname model.Hostname, ports []string) []string
GetIstioServiceAccounts implements model.ServiceAccounts operation TODO
func (*Controller) GetProxyServiceInstances ¶
func (c *Controller) GetProxyServiceInstances(proxy *model.Proxy) ([]*model.ServiceInstance, error)
func (*Controller) GetService ¶
GetService retrieve dedicated service with specific host name
func (*Controller) GetServiceAttributes ¶
func (sd *Controller) GetServiceAttributes(hostname model.Hostname) (*model.ServiceAttributes, error)
GetServiceAttributes implements a service catalog operation.
func (*Controller) Instances ¶
func (c *Controller) Instances(hostname model.Hostname, ports []string, labels model.LabelsCollection) ([]*model.ServiceInstance, error)
Instances list all instance for a specific host name
func (*Controller) InstancesByPort ¶
func (c *Controller) InstancesByPort(hostname model.Hostname, port int, labels model.LabelsCollection) ([]*model.ServiceInstance, error)
Instances list all instance for a specific host name
func (*Controller) ManagementPorts ¶
func (c *Controller) ManagementPorts(addr string) model.PortList
func (*Controller) Run ¶
func (c *Controller) Run(stop <-chan struct{})
Run until a signal is received
func (*Controller) Services ¶
func (c *Controller) Services() ([]*model.Service, error)
Services list all service within zookeeper registry
func (*Controller) WorkloadHealthCheckInfo ¶
func (c *Controller) WorkloadHealthCheckInfo(addr string) model.ProbeList
WorkloadHealthCheckInfo retrieves set of health check info by instance IP. This will be implemented later
type Instance ¶
Instance is the instance of the service provider instance lables includes:
appName name of the application which host the service itself language language the service is build with rpcVer version of the sofa rpc framework dynamic ... tartTime time when this instance is started version version of this service instance accepts ... delay ... weight route weight of this instance timeout server side timeout id id of the service, already deprecated pid process id of the service instance uniqueId unique id of the service
type ServiceEvent ¶
type ServiceEvent struct { EventType ServiceEventType Service *Service Instance *Instance }
type ServiceEventType ¶
type ServiceEventType int
const ( ServiceAdded ServiceEventType = iota ServiceDeleted ServiceInstanceAdded ServiceInstanceDeleted )