consul

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddKV added in v0.4.10

func AddKV(prefix string, user string, key string, val string, conn *consulapi.Client) (err error, mess string)

AddKV - добавляем ключ в Consul KV

func GetKV added in v0.4.6

func GetKV(prefix string, user string, key string, defaultVal string, conn *consulapi.Client) (val string)

GetKV - получить данные для клюса

func Register

func Register(name string, namespace string, host string, port int, target string, interval time.Duration, ttl int, unregister bool, verbose int) error

Register is the helper function to self-register service into Etcd/Consul server name - service name host - service host port - service port target - consul dial address, for example: "127.0.0.1:8500" interval - interval of self-register to etcd ttl - ttl of the register information debug - show register message

func UnRegister

func UnRegister(name string, host string, port int, target string, verbose int)

Types

type ClientConsul added in v0.5.0

type ClientConsul struct {
	Client  *consulapi.Client
	Address string
	Config  *consulapi.Config
	Verbose int
	Err     error
}

func NewClientConsul added in v0.5.0

func NewClientConsul(addr string, verbose int) *ClientConsul

func (*ClientConsul) AddKV added in v0.5.0

func (c *ClientConsul) AddKV(key string, val []byte) (err error)

func (*ClientConsul) AddKVstring added in v0.5.0

func (c *ClientConsul) AddKVstring(key string, val string) (err error)

func (*ClientConsul) GetKV added in v0.5.0

func (c *ClientConsul) GetKV(path string) (val []byte, err error)

func (*ClientConsul) GetKVstring added in v0.5.0

func (c *ClientConsul) GetKVstring(path string, defaultVal string) (val string, err error)

Jump to

Keyboard shortcuts

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