Documentation ¶
Index ¶
Constants ¶
View Source
const ( CMD_SET_PRO = iota // 注册客户端操作,加入到指定分组 CMD_AUTH // 认证(暂未使用) CMD_ERROR // 错误响应 CMD_TICK // 心跳包 CMD_EVENT // 事件 CMD_AGENT CMD_STOP CMD_RELOAD CMD_SHOW_MEMBERS CMD_POS )
View Source
const ( EV_ADD = 1 EV_DELETE = 2 // need to delete service )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Services map[string]*serverNode //string // contains filtered or unexported fields }
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
type ClientOption ¶
type ClientOption func(client *Client)
func OnEventOption ¶
func OnEventOption(f OnEventFunc) ClientOption
func SetConsulAddress ¶
func SetConsulAddress(a string) ClientOption
func SetServices ¶
func SetServices(ss []string) ClientOption
type ConsulWatcher ¶
type ConsulWatcher struct {
// contains filtered or unexported fields
}
ConsulWatcher is the implementation of grpc.naming.Watcher
type OnEventFunc ¶
type OnEventFunc func(data map[string]interface{})
Click to show internal directories.
Click to hide internal directories.