Versions in this module Expand all Collapse all v1 v1.4.18 Sep 1, 2022 v1.4.17 Aug 29, 2022 v1.4.16 Apr 25, 2022 v1.4.15 Apr 24, 2022 Changes in this version + var JudgeGuest func(session Session) bool + var RPCParamProtocolMarshalType = "ProtocolMarshal" + var RPCParamSessionType = "SESSION" + type Agent interface + Close func() + ConnTime func() time.Time + Destroy func() + GetError func() error + GetSession func() Session + IsClosed func() bool + OnClose func() error + OnInit func(gate Gate, conn network.Conn) error + ProtocolOK func() bool + RevNum func() int64 + Run func() (err error) + SendNum func() int64 + WriteMsg func(topic string, body []byte) error + type AgentLearner interface + Connect func(a Agent) + DisConnect func(a Agent) + type Gate interface + GetAgentLearner func() AgentLearner + GetGateHandler func() GateHandler + GetJudgeGuest func() func(session Session) bool + GetRouteHandler func() RouteHandler + GetSessionLearner func() SessionLearner + GetStorageHandler func() StorageHandler + NewSession func(data []byte) (Session, error) + NewSessionByMap func(data map[string]interface{}) (Session, error) + Options func() Options + type GateHandler interface + Bind func(span log.TraceSpan, Sessionid string, Userid string) (result Session, err string) + BroadCast func(span log.TraceSpan, topic string, body []byte) (int64, string) + Close func(span log.TraceSpan, Sessionid string) (result interface{}, err string) + GetAgent func(Sessionid string) (Agent, error) + GetAgentNum func() int + IsConnect func(span log.TraceSpan, Sessionid string, Userid string) (result bool, err string) + OnDestroy func() + Push func(span log.TraceSpan, Sessionid string, Settings map[string]string) (result Session, err string) + Remove func(span log.TraceSpan, Sessionid string, key string) (result interface{}, err string) + Send func(span log.TraceSpan, Sessionid string, topic string, body []byte) (result interface{}, err string) + SendBatch func(span log.TraceSpan, Sessionids string, topic string, body []byte) (int64, string) + Set func(span log.TraceSpan, Sessionid string, key string, value string) (result Session, err string) + UnBind func(span log.TraceSpan, Sessionid string) (result Session, err string) + Update func(span log.TraceSpan, Sessionid string) (result Session, err string) + type Option func(*Options) + func BufSize(s int) Option + func CertFile(s string) Option + func ConcurrentTasks(s int) Option + func Heartbeat(s time.Duration) Option + func KeyFile(s string) Option + func MaxPackSize(s int) Option + func OverTime(s time.Duration) Option + func ServerOpts(s []server.Option) Option + func SetAgentLearner(s AgentLearner) Option + func SetGateHandler(s GateHandler) Option + func SetRouteHandler(s RouteHandler) Option + func SetSendMessageHook(s SendMessageHook) Option + func SetSessionLearner(s SessionLearner) Option + func SetStorageHandler(s StorageHandler) Option + func TCPAddr(s string) Option + func TLS(s bool) Option + func TcpAddr(s string) Option + func Tls(s bool) Option + func WsAddr(s string) Option + type Options struct + AgentLearner AgentLearner + BufSize int + CertFile string + ConcurrentTasks int + GateHandler GateHandler + Heartbeat time.Duration + KeyFile string + MaxPackSize int + Opts []server.Option + OverTime time.Duration + RouteHandler RouteHandler + SendMessageHook SendMessageHook + SessionLearner SessionLearner + StorageHandler StorageHandler + TCPAddr string + TLS bool + WsAddr string + func NewOptions(opts ...Option) Options + type RouteHandler interface + OnRoute func(session Session, topic string, msg []byte) (bool, interface{}, error) + type SendMessageHook func(session Session, topic string, msg []byte) ([]byte, error) + type Session interface + Bind func(UserID string) (err string) + Clone func() Session + CloneSettings func() map[string]string + Close func() (err string) + CreateTrace func() + ExtractSpan func() log.TraceSpan + Get func(key string) (result string) + GetIP func() string + GetNetwork func() string + GetServerID func() string + GetServerId func() string + GetSessionID func() string + GetSessionId func() string + GetTopic func() string + GetUserID func() string + GetUserIDInt64 func() int64 + GetUserId func() string + GetUserIdInt64 func() int64 + ImportSettings func(map[string]string) error + IsConnect func(Userid string) (result bool, err string) + IsGuest func() bool + JudgeGuest func(judgeGuest func(session Session) bool) + Load func(key string) (result string, ok bool) + LocalUserData func() interface{} + Push func() (err string) + Remove func(key string) (err string) + RemoveLocalKV func(key string) error + Send func(topic string, body []byte) (err string) + SendBatch func(Sessionids string, topic string, body []byte) (int64, string) + SendNR func(topic string, body []byte) (err string) + Serializable func() ([]byte, error) + Set func(key string, value string) (err string) + SetBatch func(settings map[string]string) (err string) + SetIP func(ip string) + SetLocalKV func(key, value string) error + SetLocalUserData func(data interface{}) error + SetNetwork func(network string) + SetPush func(key string, value string) (err string) + SetServerID func(serverid string) + SetServerId func(serverid string) + SetSessionID func(sessionid string) + SetSessionId func(sessionid string) + SetSettings func(settings map[string]string) + SetTopic func(topic string) + SetUserID func(userid string) + SetUserId func(userid string) + SettingsRange func(func(k, v string) bool) + SpanID func() string + SpanId func() string + TraceID func() string + TraceId func() string + UnBind func() (err string) + Update func() (err string) + type SessionLearner interface + Connect func(a Session) + DisConnect func(a Session) + type StorageHandler interface + Delete func(session Session) (err error) + Heartbeat func(session Session) + Query func(Userid string) (data []byte, err error) + Storage func(session Session) (err error)