consul

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Client

type Client struct {
	*Options
	// contains filtered or unexported fields
}

func NewClient

func NewClient(o *Options, logger *zap.Logger) (*Client, error)

func (*Client) Deregister

func (c *Client) Deregister(_ context.Context, service *registry.ServiceInstance) error

func (*Client) Register

func (c *Client) Register(_ context.Context, service *registry.ServiceInstance) (err error)

type Options

type Options struct {
	Addr                           string `mapstructure:"addr"`
	EnableHealthCheck              bool   `mapstructure:"enable_health_check"`
	HealthCheckInterval            int    `mapstructure:"health_check_interval"`
	DeregisterCriticalServiceAfter int    `mapstructure:"deregister_critical_service_after"`
	HeartBeat                      bool   `mapstructure:"heart_beat"`
}

func NewOptions

func NewOptions(v *viper.Viper) (*Options, error)

NewOptions creates a new set of o for the consul client.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func New

func New(client *Client) *Registry

func (*Registry) Deregister

func (r *Registry) Deregister(ctx context.Context, service *registry.ServiceInstance) error

func (*Registry) Register

func (r *Registry) Register(ctx context.Context, service *registry.ServiceInstance) error

Jump to

Keyboard shortcuts

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