Documentation ¶
Overview ¶
Consul KV structure services/{group}/{service}/{version}
Consul Service Structure {group}-{service.replace('.','-')}-{version}
Index ¶
- func GetServiceKeyPrefix(c srpc.ServiceCoordinate) string
- func GetServiceMeta(c srpc.ServiceCoordinate) map[string]string
- func GetServiceName(c srpc.ServiceCoordinate) string
- func GetServiceSelector(c srpc.ServiceCoordinate) (serviceName string, tags []string)
- func GetServiceTags(c srpc.ServiceCoordinate) []string
- func SetServiceRegistration(c srpc.ServiceCoordinate, r *consulapi.AgentServiceRegistration) *consulapi.AgentServiceRegistration
- type Configurer
- type KeyValueChangeWatcher
- type ServiceConfigurerOptions
- type StateChangeWatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetServiceKeyPrefix ¶
func GetServiceKeyPrefix(c srpc.ServiceCoordinate) string
Prefix of service kv store
func GetServiceMeta ¶
func GetServiceMeta(c srpc.ServiceCoordinate) map[string]string
func GetServiceSelector ¶
func GetServiceSelector(c srpc.ServiceCoordinate) (serviceName string, tags []string)
func GetServiceTags ¶
func GetServiceTags(c srpc.ServiceCoordinate) []string
func SetServiceRegistration ¶
func SetServiceRegistration(c srpc.ServiceCoordinate, r *consulapi.AgentServiceRegistration) *consulapi.AgentServiceRegistration
Types ¶
type Configurer ¶
type Configurer interface { Run() error // blocked run Ready() <-chan struct{} IsReady() bool Stop() }
func NewServiceConfigurer ¶
func NewServiceConfigurer(opts ServiceConfigurerOptions) (Configurer, error)
type KeyValueChangeWatcher ¶
type KeyValueChangeWatcher struct { Client *consulapi.Client QueryOptions *consulapi.QueryOptions Key string Wait time.Duration Value func([]byte) Ready func() Logger kitlog.Logger // contains filtered or unexported fields }
func (*KeyValueChangeWatcher) Stop ¶
func (r *KeyValueChangeWatcher) Stop()
func (*KeyValueChangeWatcher) Watch ¶
func (r *KeyValueChangeWatcher) Watch()
type StateChangeWatcher ¶
type StateChangeWatcher struct { Value interface{} Wait time.Duration Change func([]byte) Ready func() Logger kitlog.Logger // contains filtered or unexported fields }
func (*StateChangeWatcher) Stop ¶
func (r *StateChangeWatcher) Stop()
func (*StateChangeWatcher) Watch ¶
func (r *StateChangeWatcher) Watch()
Click to show internal directories.
Click to hide internal directories.