Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByEtcdServiceID ¶
type ByEtcdServiceID []EtcdServiceNode
ByEtcdServiceID implements the Sort interface because Go can't sort without it.
func (ByEtcdServiceID) Len ¶
func (se ByEtcdServiceID) Len() int
func (ByEtcdServiceID) Less ¶
func (se ByEtcdServiceID) Less(i, j int) bool
func (ByEtcdServiceID) Swap ¶
func (se ByEtcdServiceID) Swap(i, j int)
type ByServiceID ¶
type ByServiceID []*consul.ServiceEntry
ByServiceID implements the Sort interface because Go can't sort without it.
func (ByServiceID) Len ¶
func (se ByServiceID) Len() int
func (ByServiceID) Less ¶
func (se ByServiceID) Less(i, j int) bool
func (ByServiceID) Swap ¶
func (se ByServiceID) Swap(i, j int)
type Consul ¶
Consul is a service discovery backend for Hashicorp Consul
func NewConsulConfig ¶
NewConsulConfig creates a new service discovery backend for Consul
func (Consul) CheckForUpstreamChanges ¶
CheckForUpstreamChanges runs the health check
func (Consul) Deregister ¶
func (c Consul) Deregister(service *ServiceDefinition)
Deregister removes the node from Consul.
func (Consul) MarkForMaintenance ¶
func (c Consul) MarkForMaintenance(service *ServiceDefinition)
MarkForMaintenance removes the node from Consul.
func (Consul) SendHeartbeat ¶
func (c Consul) SendHeartbeat(service *ServiceDefinition)
SendHeartbeat writes a TTL check status=ok to the consul store. If consul has never seen this service, we register the service and its TTL check.
type DiscoveryService ¶
type DiscoveryService interface { SendHeartbeat(service *ServiceDefinition) CheckForUpstreamChanges(backendName string, backendTag string) bool MarkForMaintenance(service *ServiceDefinition) Deregister(service *ServiceDefinition) }
DiscoveryService is an interface which all service discovery backends must implement
type Etcd ¶
Etcd is a service discovery backend for CoreOS etcd
func NewEtcdConfig ¶
func NewEtcdConfig(config json.RawMessage) Etcd
NewEtcdConfig creates a new service discovery backend for etcd
func (Etcd) CheckForUpstreamChanges ¶
CheckForUpstreamChanges checks another etcd node for changes
func (Etcd) Deregister ¶
func (c Etcd) Deregister(service *ServiceDefinition)
Deregister removes this instance from the registry
func (Etcd) MarkForMaintenance ¶
func (c Etcd) MarkForMaintenance(service *ServiceDefinition)
MarkForMaintenance removes this instance from the registry
func (Etcd) SendHeartbeat ¶
func (c Etcd) SendHeartbeat(service *ServiceDefinition)
SendHeartbeat refreshes the TTL of this associated etcd node