consul

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrRegisterFailed 服务注册失败
	ErrRegisterFailed = errors.New("consul: register server failed")
)

Functions

func GetAndWatchPrefix

func GetAndWatchPrefix(prefix string, f func(map[string][]byte)) (cancel func())

GetAndWatchPrefix 先getPrefix并回调一次f,然后WatchPrefix

func GetClient

func GetClient() *consul.Client

GetClient 获取cosul客户端

func GetServiceAddress

func GetServiceAddress(name string) string

GetServiceAddress 获取服务地址(随机)

func NewClient

func NewClient(config *consul.Config) (*consul.Client, error)

NewClient 新建consul客户端

func RegisterToConsul

func RegisterToConsul(s *api.Conf) error

RegisterToConsul 服务注册到consul

Types

This section is empty.

Jump to

Keyboard shortcuts

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