consul

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package consul is a wrapper around the Hashicorp Consul service discovery functionnality

Consul is a highly available and distributed service discovery and key-value store designed with support for the modern data center to make distributed systems and configuration easy.

Index

Constants

View Source
const Name = "consul"

Name contains the adapter registered name

Variables

This section is empty.

Functions

func New

func New(tree config.Tree) (disco.Agent, error)

New returns a new file config store

Types

type Agent

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

func (*Agent) Deregister

func (a *Agent) Deregister(ctx context.Context, id string) error

func (*Agent) Leave

func (a *Agent) Leave(ctx context.Context)

func (*Agent) Register

func (a *Agent) Register(ctx context.Context, r *disco.Registration) (string, error)

func (*Agent) Service

func (a *Agent) Service(
	ctx context.Context, name string, tags ...string,
) (disco.Service, error)

func (*Agent) Services

func (a *Agent) Services(
	ctx context.Context, tags ...string,
) (map[string]disco.Service, error)

type Config

type Config struct {
	AdvertiseAddr string   `json:"advertise_addr"`
	DefaultTags   []string `json:"default_tags"`
	Address       string   `json:"address"`
	DC            string   `json:"dc"`
	Token         string   `json:"token"`
}

Config contains the configuration to start a service discovery agent

Jump to

Keyboard shortcuts

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