Documentation
¶
Index ¶
- Constants
- Variables
- func GetUsername(re *Parameter) string
- type Context
- func (context *Context) AddUser(iUser user.IUser)
- func (context *Context) DeleteUser(iUser user.IUser) bool
- func (context *Context) FlashLiveTime(iUser user.IUser)
- 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) GetHistory(userName string) (*user.HistoryMessage, bool)
- func (context *Context) GetHttpPush() *HttpPush
- func (context *Context) GetLog() *zap.Logger
- func (context *Context) GetSystemInfo() systemInfo
- func (context *Context) GetUser(userName string) ([]user.IUser, bool)
- func (context *Context) GetUserAllOrder(username string) []user.IOrderUser
- func (context *Context) GetUserNum() int
- func (context *Context) Go(handle func())
- func (context *Context) GoForIndex(index int, handle func(ind int))
- func (context *Context) Query(parameter *Parameter) any
- func (context *Context) RangeUser(f func(username string, user *user.StoreUser) bool)
- func (context *Context) RecordMessage(msg message.IMessage)
- func (context *Context) RecoverGo(handle func())
- func (context *Context) RegisterHandle(handleName string, handle RegisterHandle)
- func (context *Context) SendGroupTextMessage(form string, groupId, msg string) int32
- func (context *Context) SendMessage(msg message.IMessage) (error, bool)
- func (context *Context) SendMessageForBack(msg message.IMessage, write user.WriteCallBackFunc)
- func (context *Context) SendMultiMessageNoReplay(fromUser string, usernames []string, text string)
- func (context *Context) SendNoForwardMessage(msg message.IMessage) (error, 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 DockMessage
- type HttpPush
- type IForward
- type IHttpServer
- type MsgDock
- func (md *MsgDock) HandleAddUser(iUser user.IUser)
- func (md *MsgDock) HandleDeleteUser(username string)
- func (md *MsgDock) Query(parameter *Parameter, localValue any) []any
- func (md *MsgDock) WriteMessage(msg message.IMessage, writeFunc user.WriteCallBackFunc)
- func (md *MsgDock) WriteNoForwardMessage(msg message.IMessage, writeFunc user.WriteCallBackFunc)
- type Parameter
- type Register
- type RegisterHandle
- type Server
Constants ¶
View Source
const (
VERSION = "0.1.10"
)
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) FlashLiveTime ¶ added in v0.1.16
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) GetHistory ¶ added in v0.0.6
func (context *Context) GetHistory(userName string) (*user.HistoryMessage, bool)
func (*Context) GetHttpPush ¶
func (*Context) GetSystemInfo ¶
func (context *Context) GetSystemInfo() systemInfo
func (*Context) GetUserAllOrder ¶ added in v0.1.1
func (context *Context) GetUserAllOrder(username string) []user.IOrderUser
func (*Context) GetUserNum ¶
func (*Context) Go ¶ added in v0.1.14
func (context *Context) Go(handle func())
Go 协程异常保活,避免协程内错误导致整个系统
func (*Context) GoForIndex ¶ added in v0.1.27
GoForIndex 协程异常保活,避免协程内错误导致整个系统
func (*Context) RecordMessage ¶ added in v0.1.16
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) SendGroupTextMessage ¶
func (*Context) SendMessage ¶
func (*Context) SendMessageForBack ¶ added in v0.0.5
func (context *Context) SendMessageForBack(msg message.IMessage, write user.WriteCallBackFunc)
func (*Context) SendMultiMessageNoReplay ¶ added in v0.1.27
func (*Context) SendNoForwardMessage ¶
func (*Context) SendTextMessage ¶
func (*Context) SetForward ¶
func (*Context) SetSystemInfo ¶
type DockMessage ¶
type IForward ¶
type IForward interface { HandleAddUser(iUser user.IUser) HandleDeleteUser(username string) WriteMessage(iMessage message.IMessage, exMachineId []string, writeFunc user.WriteCallBackFunc) GetOrderUser(username string) ([]user.IOrderUser, bool) 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) HandleAddUser ¶
func (*MsgDock) HandleDeleteUser ¶
func (*MsgDock) WriteMessage ¶
func (md *MsgDock) WriteMessage(msg message.IMessage, writeFunc user.WriteCallBackFunc)
func (*MsgDock) WriteNoForwardMessage ¶
func (md *MsgDock) WriteNoForwardMessage(msg message.IMessage, writeFunc user.WriteCallBackFunc)
type Register ¶
type Register struct {
// contains filtered or unexported fields
}
func NewRegister ¶
type RegisterHandle ¶
Click to show internal directories.
Click to hide internal directories.