discoconsul

package module
v0.0.0-...-6de2257 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2023 License: BSD-3-Clause Imports: 12 Imported by: 1

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{}

func (*ServiceDiscoverer) Start

func (d *ServiceDiscoverer) Start(ctx context.Context) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL