gclient

package
v0.0.0-...-5b4c1f5 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUser

func GetUser(s *Module, uid string, pwd string) (string, server.Ret)

GetUser user to login

func ModuleCreate

func ModuleCreate() (server.Module, error)

ModuleCreate module create function

func NewAgentAdapter

func NewAgentAdapter(conn network.IConn) network.IAgentAdapter

NewAgentAdapter create agent adapter

Types

type AgentAdapter

type AgentAdapter struct {
	network.AgentAdapter
	Cache *skiplist.SkipList
}

AgentAdapter do agent hander

func (*AgentAdapter) OnClose

func (a *AgentAdapter) OnClose()

OnClose agent close and clear

func (*AgentAdapter) ProcessMessage

func (a *AgentAdapter) ProcessMessage(payload interface{}) error

ProcessMessage process request and notify message

func (*AgentAdapter) RPCCall

func (a *AgentAdapter) RPCCall(msg *ss.Message) (*ss.Message, server.Ret)

RPCCall remote call

func (*AgentAdapter) ReadMessage

func (a *AgentAdapter) ReadMessage() (interface{}, error)

ReadMessage goroutine not safe

func (*AgentAdapter) WriteMessage

func (a *AgentAdapter) WriteMessage(payload interface{}) error

WriteMessage to connection

type Module

type Module struct {
	server.BaseContext

	Clients *skiplist.SkipList
	// contains filtered or unexported fields
}

Module struct to define module

func (*Module) GetAgent

func (s *Module) GetAgent(option uint32) network.IAgent

GetAgent get agent by option

func (*Module) Handlers

func (s *Module) Handlers() map[string]interface{}

Handlers set moudle handlers

func (*Module) OnRun

func (s *Module) OnRun(dt time.Duration)

OnRun goruntine run and call OnRun , always use ModuleRun to call this function

func (*Module) PushBytes

func (s *Module) PushBytes(option int32, buf []byte) error

PushBytes async send string or bytes to queue

func (*Module) ReadConfig

func (s *Module) ReadConfig(conf server.IConfig) error

ReadConfig config map address default :80

func (*Module) ReflectHandlers

func (s *Module) ReflectHandlers() map[string]interface{}

ReflectHandlers set moudle reflect handlers

func (*Module) Reload

func (s *Module) Reload(conf server.IConfig) error

Reload reload config

func (*Module) Setup

func (s *Module) Setup(conf server.IConfig) (server.Module, error)

Setup init custom module and pass config map to module config

m := map[string]interface{}{
 "queueSize":1000,
 "grpcAddress":14000,
}

func (*Module) Stop

func (s *Module) Stop() error

Stop goruntine

func (*Module) UserData

func (s *Module) UserData() int32

UserData module custom option, can you store you data and you must keep goruntine safe

Jump to

Keyboard shortcuts

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