client

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: MIT Imports: 10 Imported by: 1

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

func (*Client) Close

func (client *Client) Close()

func (*Client) Subscribe

func (client *Client) Subscribe(topics ...string)

这里的主题,其实就是 database.table 数据库.表明 支持正则,比如test库下面的所有表:test.*

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 Node

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

type OnEventFunc

type OnEventFunc func(data map[string]interface{})

Jump to

Keyboard shortcuts

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