Documentation
¶
Index ¶
- func AddKV(prefix string, user string, key string, val string, conn *consulapi.Client) (err error, mess string)
- func GetKV(prefix string, user string, key string, defaultVal string, ...) (val string)
- func Register(name string, namespace string, host string, port int, target string, ...) error
- func UnRegister(name string, host string, port int, target string, verbose int)
- type ClientConsul
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
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)
Click to show internal directories.
Click to hide internal directories.