consul

package
v0.0.0-...-273cdd3 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Loose  = false
	Strict = true
)

Variables

View Source
var ErrNotFound = errors.New("key not found")

Functions

func Pairs

func Pairs(prefix string, pairs api.KVPairs, receiver interface{}, strict bool) error

Types

type Client

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

func New

func New(addr string) (*Client, error)

func (*Client) Address

func (client *Client) Address() string

func (*Client) KV

func (client *Client) KV() *KV

func (*Client) Register

func (client *Client) Register() *Register

func (*Client) Watcher

func (client *Client) Watcher() *Watcher

type KV

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

func (*KV) Delete

func (kv *KV) Delete(key string) error

func (*KV) Get

func (kv *KV) Get(key string, value interface{}) (bool, error)

func (*KV) KV

func (kv *KV) KV() *api.KV

func (*KV) List

func (kv *KV) List(prefix string) (api.KVPairs, error)

func (*KV) ListLoose

func (kv *KV) ListLoose(prefix string, receiver interface{}) error

func (*KV) ListStrict

func (kv *KV) ListStrict(prefix string, receiver interface{}) error

func (*KV) Set

func (kv *KV) Set(key string, value interface{}) error

type Plan

type Plan interface {
	Stop()
}

type Register

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

func (*Register) Deregister

func (rg *Register) Deregister(svciD string)

func (*Register) Register

func (rg *Register) Register(svcName, address string, meta map[string]string) (reg *api.AgentServiceRegistration, err error)

type Watcher

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

func (*Watcher) Prefix

func (watcher *Watcher) Prefix(prefix string, handler watch.HandlerFunc) (Plan, error)

func (*Watcher) Service

func (watcher *Watcher) Service(svc string, handler watch.HandlerFunc) (Plan, error)

Jump to

Keyboard shortcuts

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