Documentation ¶
Index ¶
- Constants
- type ConsulServiceRegistry
- func (c *ConsulServiceRegistry) ApplyServiceInstances(instances map[string]*serviceregistry.ServiceInstanceSpec) error
- func (c *ConsulServiceRegistry) Category() supervisor.ObjectCategory
- func (c *ConsulServiceRegistry) Close()
- func (c *ConsulServiceRegistry) DefaultSpec() interface{}
- func (c *ConsulServiceRegistry) DeleteServiceInstances(instances map[string]*serviceregistry.ServiceInstanceSpec) error
- func (c *ConsulServiceRegistry) GetServiceInstance(serviceName, instanceID string) (*serviceregistry.ServiceInstanceSpec, error)
- func (c *ConsulServiceRegistry) Inherit(superSpec *supervisor.Spec, previousGeneration supervisor.Object)
- func (c *ConsulServiceRegistry) Init(superSpec *supervisor.Spec)
- func (c *ConsulServiceRegistry) Kind() string
- func (c *ConsulServiceRegistry) ListAllServiceInstances() (map[string]*serviceregistry.ServiceInstanceSpec, error)
- func (c *ConsulServiceRegistry) ListServiceInstances(serviceName string) (map[string]*serviceregistry.ServiceInstanceSpec, error)
- func (c *ConsulServiceRegistry) Name() string
- func (c *ConsulServiceRegistry) Notify() <-chan *serviceregistry.RegistryEvent
- func (c *ConsulServiceRegistry) Status() *supervisor.Status
- type Spec
- type Status
Constants ¶
const ( // Category is the category of ConsulServiceRegistry. Category = supervisor.CategoryBusinessController // Kind is the kind of ConsulServiceRegistry. Kind = "ConsulServiceRegistry" // MetaKeyRegistryName is the key of service metadata. // NOTE: Namespace is only available for Consul Enterprise, // instead we use this field to work around. MetaKeyRegistryName = "RegistryName" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsulServiceRegistry ¶
type ConsulServiceRegistry struct {
// contains filtered or unexported fields
}
ConsulServiceRegistry is Object ConsulServiceRegistry.
func (*ConsulServiceRegistry) ApplyServiceInstances ¶
func (c *ConsulServiceRegistry) ApplyServiceInstances(instances map[string]*serviceregistry.ServiceInstanceSpec) error
ApplyServiceInstances applies service instances to the registry.
func (*ConsulServiceRegistry) Category ¶
func (c *ConsulServiceRegistry) Category() supervisor.ObjectCategory
Category returns the category of ConsulServiceRegistry.
func (*ConsulServiceRegistry) Close ¶
func (c *ConsulServiceRegistry) Close()
Close closes ConsulServiceRegistry.
func (*ConsulServiceRegistry) DefaultSpec ¶
func (c *ConsulServiceRegistry) DefaultSpec() interface{}
DefaultSpec returns the default spec of ConsulServiceRegistry.
func (*ConsulServiceRegistry) DeleteServiceInstances ¶
func (c *ConsulServiceRegistry) DeleteServiceInstances(instances map[string]*serviceregistry.ServiceInstanceSpec) error
DeleteServiceInstances applies service instances to the registry.
func (*ConsulServiceRegistry) GetServiceInstance ¶
func (c *ConsulServiceRegistry) GetServiceInstance(serviceName, instanceID string) (*serviceregistry.ServiceInstanceSpec, error)
GetServiceInstance get service instance from the registry.
func (*ConsulServiceRegistry) Inherit ¶
func (c *ConsulServiceRegistry) Inherit(superSpec *supervisor.Spec, previousGeneration supervisor.Object)
Inherit inherits previous generation of ConsulServiceRegistry.
func (*ConsulServiceRegistry) Init ¶
func (c *ConsulServiceRegistry) Init(superSpec *supervisor.Spec)
Init initializes ConsulServiceRegistry.
func (*ConsulServiceRegistry) Kind ¶
func (c *ConsulServiceRegistry) Kind() string
Kind returns the kind of ConsulServiceRegistry.
func (*ConsulServiceRegistry) ListAllServiceInstances ¶
func (c *ConsulServiceRegistry) ListAllServiceInstances() (map[string]*serviceregistry.ServiceInstanceSpec, error)
ListAllServiceInstances list all service instances from the registry.
func (*ConsulServiceRegistry) ListServiceInstances ¶
func (c *ConsulServiceRegistry) ListServiceInstances(serviceName string) (map[string]*serviceregistry.ServiceInstanceSpec, error)
ListServiceInstances list service instances of one service from the registry.
func (*ConsulServiceRegistry) Name ¶
func (c *ConsulServiceRegistry) Name() string
Name returns name.
func (*ConsulServiceRegistry) Notify ¶
func (c *ConsulServiceRegistry) Notify() <-chan *serviceregistry.RegistryEvent
Notify returns notify channel.
func (*ConsulServiceRegistry) Status ¶
func (c *ConsulServiceRegistry) Status() *supervisor.Status
Status returns status of ConsulServiceRegister.
type Spec ¶
type Spec struct { Address string `yaml:"address" jsonschema:"required"` Scheme string `yaml:"scheme" jsonschema:"required,enum=http,enum=https"` Datacenter string `yaml:"datacenter" jsonschema:"omitempty"` Token string `yaml:"token" jsonschema:"omitempty"` Namespace string `yaml:"namespace" jsonschema:"omitempty"` SyncInterval string `yaml:"syncInterval" jsonschema:"required,format=duration"` ServiceTags []string `yaml:"serviceTags" jsonschema:"omitempty"` }
Spec describes the ConsulServiceRegistry.