consul

package module
v0.0.0-...-9d8ded8 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consul

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

Consul is a client for https://consul.io/.

func New

func New(o *Options) (*Consul, error)

New returns a new Consul.

func (*Consul) Delete

func (c *Consul) Delete(key string) error

Delete implements the kv.KV interface.

func (*Consul) DeleteTree

func (c *Consul) DeleteTree(prefix string) error

DeleteTree implements the kv.KV interface.

func (*Consul) Exists

func (c *Consul) Exists(key string) (bool, error)

Exists implements the kv.KV interface.

func (*Consul) Get

func (c *Consul) Get(key string) ([]byte, error)

Get implements the kv.KV interface.

func (*Consul) List

func (c *Consul) List(prefix string) (map[string][]byte, error)

List implements the kv.KV interface.

func (*Consul) NewLocker

func (c *Consul) NewLocker(key string) kv.Locker

NewLocker implements the kv.KV interface.

func (*Consul) NewWatcher

func (c *Consul) NewWatcher(prefix string) kv.Watcher

NewWatcher implements the kv.KV interface.

func (*Consul) Put

func (c *Consul) Put(key string, value []byte) error

Put implements the kv.KV interface.

type Locker

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

func (*Locker) Lock

func (l *Locker) Lock() error

Lock implements the kv.Locker interface.

func (*Locker) Unlock

func (l *Locker) Unlock() error

Unlock implements the kv.Locker interface.

type Options

type Options struct {
	Address    string
	Scheme     string
	PathPrefix string
	Datacenter string
	Token      string
	Namespace  string
}

Options is Consul options.

type Watcher

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

func (*Watcher) Unwatch

func (w *Watcher) Unwatch() error

Unwatch implements the kv.Watcher interface.

func (*Watcher) Watch

func (w *Watcher) Watch() (<-chan map[string][]byte, error)

Watch implements the kv.Watcher interface.

Jump to

Keyboard shortcuts

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