control

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 5, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CMD_ERROR = iota // 错误响应
	CMD_TICK         // 心跳包
	CMD_STOP
	CMD_RELOAD
	CMD_SHOW_MEMBERS
)

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx *app.Context) *control

Types

type ControlOption

type ControlOption func(tcp *TcpService)

func Reload

func Reload(f ReloadFunc) ControlOption

func ShowMember

func ShowMember(f ShowMemberFunc) ControlOption

func Stop

func Stop(f StopFunc) ControlOption

type ReloadFunc

type ReloadFunc func(service string)

type ShowMemberFunc

type ShowMemberFunc func() string

type StopFunc

type StopFunc func()

type TcpClientNode

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

type TcpService

type TcpService struct {
	Address string
	// contains filtered or unexported fields
}

func NewControl

func NewControl(ctx *app.Context, opts ...ControlOption) *TcpService

func (*TcpService) Close

func (tcp *TcpService) Close()

func (*TcpService) Start

func (tcp *TcpService) Start()

Jump to

Keyboard shortcuts

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