Documentation
¶
Index ¶
- Constants
- Variables
- func GetUsername(re *Parameter) string
- type Context
- func (context *Context) AddUser(iUser user.IUser)
- func (context *Context) AllGroupInfo() map[string]int
- func (context *Context) DeleteUser(iUser user.IUser) bool
- func (context *Context) GetCfgBool(section, key string) bool
- func (context *Context) GetCfgBoolDefault(section, key string, defaultValue bool) bool
- func (context *Context) GetCfgInt(section, key string) int
- func (context *Context) GetCfgString(section, key string) string
- func (context *Context) GetCfgStringDefault(section, key, defaultValue string) string
- func (context *Context) GetHandle(handleName string) (RegisterHandle, bool)
- func (context *Context) GetHttpPush() *HttpPush
- func (context *Context) GetLog() *zap.Logger
- func (context *Context) GetStartTime() string
- func (context *Context) GetSystemInfo() systemInfo
- func (context *Context) GetUser(userName string) ([]user.IUser, bool)
- func (context *Context) GetUserCreateTime(userName string) *time.Time
- func (context *Context) GetUserNum() int
- func (context *Context) GetUserOrder(username string) []user.IOrderUser
- func (context *Context) Go(handle func())
- func (context *Context) Query(parameter *Parameter) any
- func (context *Context) RangeUser(f func(username string, user *user.StoreUser) bool)
- func (context *Context) RecoverGo(handle func())
- func (context *Context) RegisterHandle(handleName string, handle RegisterHandle)
- func (context *Context) SendAsyncMessage(msg message.IMessage, write user.WriteCallBackFunc)
- func (context *Context) SendGroupTextMessage(form string, groupId, msg string) int32
- func (context *Context) SendLocalMessage(msg message.IMessage) (err error, fa bool)
- func (context *Context) SendMessage(msg message.IMessage) (err error, fa bool)
- func (context *Context) SendTextMessage(from string, to string, msg string) (error, bool)
- func (context *Context) SetForward(forward IForward)
- func (context *Context) SetSystemInfo(key string, value any)
- type HttpPush
- type IForward
- type IHttpServer
- type MsgDock
- type Parameter
- func (m *Parameter) CopyParameter() *Parameter
- func (m *Parameter) GetIndex() int
- func (m *Parameter) GetInt(key string) int
- func (m *Parameter) GetString(key string) string
- func (m *Parameter) GetVString(keys ...string) string
- func (m *Parameter) SetIndex(index int)
- func (m *Parameter) SetString(key string, value string)
- type Register
- type RegisterHandle
- type Server
Constants ¶
View Source
const (
VERSION = "0.2.1"
)
Variables ¶
View Source
var ConnOnCreating = errors.New("conn on creating ")
View Source
var MessageIdIsBlank = errors.New("message Id is blank")
View Source
var NetError = errors.New("net ERROR")
View Source
var NoFoundUser = errors.New("NOT FOUND USER")
View Source
var ProtocolError = errors.New("km protocolError")
View Source
var ReadTimeout = errors.New("read timeout")
View Source
var UnKnownClassId = errors.New("UNKNOWN CLASS ID")
View Source
var UnKnownConn = errors.New("UNKNOWN Conn")
View Source
var UnKnownMessageType = errors.New("UNKNOWN MESSAGE TYPE")
View Source
var UnKnownVersion = errors.New("UNKNOWN Version")
Functions ¶
func GetUsername ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) AllGroupInfo ¶ added in v0.2.5
func (*Context) GetCfgBool ¶ added in v0.1.18
func (*Context) GetCfgBoolDefault ¶ added in v0.1.18
func (*Context) GetCfgString ¶
func (*Context) GetCfgStringDefault ¶ added in v0.0.7
func (*Context) GetHandle ¶
func (context *Context) GetHandle(handleName string) (RegisterHandle, bool)
func (*Context) GetHttpPush ¶
func (*Context) GetStartTime ¶ added in v0.2.5
func (*Context) GetSystemInfo ¶
func (context *Context) GetSystemInfo() systemInfo
func (*Context) GetUserCreateTime ¶ added in v0.1.32
func (*Context) GetUserNum ¶
func (*Context) GetUserOrder ¶ added in v0.1.32
func (context *Context) GetUserOrder(username string) []user.IOrderUser
func (*Context) RecoverGo ¶ added in v0.1.14
func (context *Context) RecoverGo(handle func())
RecoverGo 协程异常恢复,异常后,会重启当前协程
func (*Context) RegisterHandle ¶
func (context *Context) RegisterHandle(handleName string, handle RegisterHandle)
func (*Context) SendAsyncMessage ¶ added in v0.1.36
func (context *Context) SendAsyncMessage(msg message.IMessage, write user.WriteCallBackFunc)
func (*Context) SendGroupTextMessage ¶
func (*Context) SendLocalMessage ¶ added in v0.1.35
func (*Context) SendMessage ¶
func (*Context) SendTextMessage ¶
func (*Context) SetForward ¶
func (*Context) SetSystemInfo ¶
type IForward ¶
type IForward interface { WriteSyncMessage(iMessage message.IMessage) (bool, error) Query(parameter *Parameter, localValue any) []any }
IForward 集群使用/*
type IHttpServer ¶
type IHttpServer interface { AddHttpRoute(pattern string, handler func(http.ResponseWriter, *http.Request)) GetServerHost() string // contains filtered or unexported methods }
func NewHttpServer ¶
func NewHttpServer(name string) IHttpServer
type MsgDock ¶
type MsgDock struct { IForward IForward // contains filtered or unexported fields }
func (*MsgDock) SendLocalMessage ¶ added in v0.1.39
type Parameter ¶
func NewParameter ¶
func (*Parameter) CopyParameter ¶ added in v0.1.30
func (*Parameter) GetVString ¶
type Register ¶
type Register struct {
// contains filtered or unexported fields
}
func NewRegister ¶
type RegisterHandle ¶
Click to show internal directories.
Click to hide internal directories.