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 ( FlagSetPro = iota FlagPing FlagControl FlagAgent )
View Source
const (
Registered = 1 << iota
)
服务注册
View Source
const ServiceName = "wing-binlog-go-agent"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentServerOption ¶
type AgentServerOption func(s *TcpService)
func OnEvent ¶
func OnEvent(f OnEventFunc) AgentServerOption
agent client 收到事件回调 这个回调应该来源于service_plugin/tcp 最终被转发到SendAll
func OnLeader ¶
func OnLeader(f OnLeaderFunc) AgentServerOption
func OnRaw ¶
func OnRaw(f OnRawFunc) AgentServerOption
agent client 收到一些其他的事件 原封不动转发到service_plugin/tcp SendRaw
type NodeOption ¶
type NodeOption func(n *tcpClientNode)
func NodeClose ¶
func NodeClose(f NodeFunc) NodeOption
func NodePro ¶
func NodePro(f NodeFunc) NodeOption
type OnEventFunc ¶
type OnLeaderFunc ¶
type OnLeaderFunc func(bool)
type TcpService ¶
type TcpService struct { Address string // 监听ip // contains filtered or unexported fields }
func NewAgentServer ¶
func NewAgentServer(ctx *app.Context, opts ...AgentServerOption) *TcpService
func (*TcpService) Close ¶
func (tcp *TcpService) Close()
func (*TcpService) ShowMembers ¶
func (tcp *TcpService) ShowMembers() string
func (*TcpService) Start ¶
func (tcp *TcpService) Start()
func (*TcpService) Sync ¶ added in v1.0.4
func (tcp *TcpService) Sync(data []byte)
此api提供给binlog通过agent server同步广播发送给所有的client客户端
Click to show internal directories.
Click to hide internal directories.