Documentation
¶
Overview ¶
Package discoconsul contains Rafty Discoverers which leverage the use of HashiCorp's Consul.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceDiscoverer ¶
type ServiceDiscoverer struct {
// contains filtered or unexported fields
}
ServiceDiscoverer is a Rafty discoverer which leverages the use of Consul services. This discoverer will register itself upon calling Start() and deregister itself when context given to Start() is canceled.
func NewServiceDiscoverer ¶
func NewServiceDiscoverer(advertisedAddr string, advertisedPort int, consulClient *api.Client, options ...ServiceOption) (*ServiceDiscoverer, error)
func (*ServiceDiscoverer) Done ¶
func (d *ServiceDiscoverer) Done() chan struct{}
func (*ServiceDiscoverer) GetServers ¶
func (d *ServiceDiscoverer) GetServers() []raft.Server
func (*ServiceDiscoverer) NewServers ¶
func (d *ServiceDiscoverer) NewServers() chan struct{}
type ServiceOption ¶
type ServiceOption func(*ServiceDiscoverer) error
func HCLogger ¶
func HCLogger(logger hclog.Logger) ServiceOption
func Logger ¶
func Logger(logger interfaces.Logger) ServiceOption
func Name ¶
func Name(name string) ServiceOption
func Tags ¶
func Tags(tags []string) ServiceOption
Click to show internal directories.
Click to hide internal directories.