cherryAgent

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WriteBacklog = 64
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	sync.RWMutex
	*Options
	cfacade.IApplication
	// contains filtered or unexported fields
}

func NewAgent

func NewAgent(app cfacade.IApplication, conn cfacade.INetConn, opts *Options) *Agent

func (*Agent) Close

func (a *Agent) Close()

func (*Agent) Kick

func (a *Agent) Kick(reason interface{})

func (*Agent) Push

func (a *Agent) Push(route string, val interface{})

func (*Agent) RPC

func (a *Agent) RPC(nodeId string, route string, req proto.Message, _ proto.Message) int32

func (*Agent) RemoteAddr

func (a *Agent) RemoteAddr() string

func (*Agent) Response

func (a *Agent) Response(mid uint, v interface{}, isError ...bool)

func (*Agent) Run

func (a *Agent) Run()

func (*Agent) SendRaw

func (a *Agent) SendRaw(bytes []byte)

func (*Agent) SetLastAt

func (a *Agent) SetLastAt()

func (*Agent) SetSession

func (a *Agent) SetSession(session *csession.Session)

type AgentBackend

type AgentBackend struct {
	cfacade.IApplication
	// contains filtered or unexported fields
}

func NewAgentBackend

func NewAgentBackend(app cfacade.IApplication, rpcClient cfacade.RPCClient, ip string) AgentBackend

func (*AgentBackend) Close

func (a *AgentBackend) Close()

func (*AgentBackend) Kick

func (a *AgentBackend) Kick(reason interface{})

func (*AgentBackend) Push

func (a *AgentBackend) Push(route string, val interface{})

func (*AgentBackend) RPC

func (a *AgentBackend) RPC(nodeId string, route string, req proto.Message, rsp proto.Message) int32

func (*AgentBackend) RemoteAddr

func (a *AgentBackend) RemoteAddr() string

func (*AgentBackend) Response

func (a *AgentBackend) Response(mid uint, val interface{}, isError ...bool)

func (*AgentBackend) SendRaw

func (a *AgentBackend) SendRaw(data []byte)

func (*AgentBackend) SetSession

func (a *AgentBackend) SetSession(session *csession.Session)

type Options

type Options struct {
	Heartbeat time.Duration               // heartbeat(sec)
	Commands  map[cpkg.Type]ccmd.ICommand // commands
}

Jump to

Keyboard shortcuts

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