Documentation ¶
Overview ¶
Copyright (c) 2023, donnie <donnie4w@gmail.com> All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
github.com/donnie4w/tim
Copyright (c) 2023, donnie <donnie4w@gmail.com> All rights reserved. Use of t source code is governed by a BSD-style license that can be found in the LICENSE file.
github.com/donnie4w/tim
Copyright (c) 2023, donnie <donnie4w@gmail.com> All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
github.com/donnie4w/tim
Index ¶
Constants ¶
View Source
const ( GROUP_PRIVATE int8 = 1 GROUP_OPEN int8 = 2 GROUP_STATUS_ALIVE int8 = 1 GROUP_STATUS_CANCELLED int8 = 2 )
View Source
const ( MB = 1 << 20 GB = 1 << 30 )
View Source
const ( TRANS_SOURCE int8 = 1 TRANS_CONSISHASH int8 = 2 TRANS_STAFF int8 = 3 TRANS_GOAL int8 = 4 )
View Source
const ( ORDER_INOF int8 = 1 ORDER_REVOKE int8 = 2 ORDER_BURN int8 = 3 ORDER_BUSINESS int8 = 4 ORDER_STREAM int8 = 5 ORDER_BIGSTRING int8 = 6 ORDER_BIGBINARY int8 = 7 ORDER_RESERVED int8 = 30 )
View Source
const ( CB_MESSAGE int8 = 1 CB_PRESENCE int8 = 2 )
View Source
const ( SOURCE_OS int8 = 1 SOURCE_USER int8 = 2 SOURCE_ROOM int8 = 3 )
View Source
const VERSION = "2.0.0"
Variables ¶
View Source
var ( BUSINESS_ROSTER int32 = 1 BUSINESS_USERROOM int32 = 2 BUSINESS_ROOMUSERS int32 = 3 BUSINESS_ADDROSTER int32 = 4 BUSINESS_FRIEND int32 = 5 BUSINESS_REMOVEROSTER int32 = 6 BUSINESS_BLOCKROSTER int32 = 7 BUSINESS_NEWROOM int32 = 8 BUSINESS_ADDROOM int32 = 9 BUSINESS_PASSROOM int32 = 10 BUSINESS_NOPASSROOM int32 = 11 BUSINESS_PULLROOM int32 = 12 BUSINESS_KICKROOM int32 = 13 BUSINESS_BLOCKROOM int32 = 14 BUSINESS_BLOCKROOMMEMBER int32 = 15 BUSINESS_LEAVEROOM int32 = 16 BUSINESS_CANCELROOM int32 = 17 BUSINESS_BLOCKROSTERLIST int32 = 18 BUSINESS_BLOCKROOMLIST int32 = 19 BUSINESS_BLOCKROOMMEMBERLIST int32 = 20 BUSINESS_MODIFYAUTH int32 = 21 )
View Source
var ( NODEINFO_ROSTER int32 = 1 NODEINFO_ROOM int32 = 2 NODEINFO_ROOMMEMBER int32 = 3 NODEINFO_USERINFO int32 = 4 NODEINFO_ROOMINFO int32 = 5 NODEINFO_MODIFYUSER int32 = 6 NODEINFO_MODIFYROOM int32 = 7 NODEINFO_BLOCKROSTERLIST int32 = 8 NODEINFO_BLOCKROOMLIST int32 = 9 NODEINFO_BLOCKROOMMEMBERLIST int32 = 10 )
View Source
var ( AckHandle func([]byte) (err ERROR) PingHandle func(*tlnet.Websocket) (err ERROR) RegisterHandle func([]byte) (node string, err ERROR) TokenHandle func([]byte) (_r int64, err ERROR) AuthHandle func([]byte, *tlnet.Websocket) (err ERROR) OfflinemsgHandle func(*tlnet.Websocket) (err ERROR) BroadpresenceHandle func([]byte, *tlnet.Websocket) (err ERROR) PullMessageHandle func([]byte, *tlnet.Websocket) (err ERROR) VRoomHandle func([]byte, *tlnet.Websocket) (err ERROR) MessageHandle func([]byte, *tlnet.Websocket) (err ERROR) BigStringHandle func([]byte, *tlnet.Websocket) (err ERROR) BigBinaryHandle func([]byte, *tlnet.Websocket) (err ERROR) BigBinaryStreamHandle func([]byte, *tlnet.Websocket) (err ERROR) RevokemessageHandle func([]byte, *tlnet.Websocket) (err ERROR) BurnmessageHandle func([]byte, *tlnet.Websocket) (err ERROR) PresenceHandle func([]byte, *tlnet.Websocket) (err ERROR) StreamHandle func([]byte, *tlnet.Websocket) (err ERROR) BusinessHandle func([]byte, *tlnet.Websocket) (err ERROR) NodeInfoHandle func([]byte, *tlnet.Websocket) (err ERROR) DataInit func() error OsToken func(string, *string, *string) (int64, string, ERROR) OsRegister func(string, string, *string) (string, ERROR) OsUserBean func(string, *TimUserBean) ERROR OsRoom func(string, string, *string, int8) (string, ERROR) OsRoomBean func(string, string, *TimRoomBean) ERROR KeyStoreInit func(string) TimMessageProcessor func(*TimMessage, int8) ERROR TimPresenceProcessor func(*TimPresence, int8) ERROR TimSteamProcessor func(*VBean) ERROR OsMessage func(*TimNodes, *TimMessage) (err ERROR) OsModify func(string, string, *string) ERROR OsVroomprocess func(string, int8) string CsMessage func(*TimMessage, int8) bool CsPresence func(*TimPresence, int8) bool CsVBean func(*VBean) bool CsNode func(string) int64 GetALLUUIDS func() []int64 Client2Serve func(string) error BroadRmNode func() error GetRemoteNode func() []*RemoteNode NodeInfo func(string) ([]byte, ERROR) SendNode func(string, thrift.TStruct, TIMTYPE) bool SendWs func(int64, thrift.TStruct, TIMTYPE) bool BlockUser func(string, int64) BlockList func() map[string]int64 WssList func() []*Tid WssInfo func(string) []byte CsWssInfo func(string) []byte WssLen func() int64 WssTt func() int64 DelWs func(*tlnet.Websocket) WsById func(int64) (*tlnet.Websocket, bool) HasNode func(string) bool HasWs func(*tlnet.Websocket) bool Unaccess func() []int64 Interrupt func(*Tid) ERROR Csuser func(string, bool, int64) error Detect func([]string) )
View Source
var ( Service = NewSortMap[int, Server]() Tim Server STARTTIME = time.Now() UUID int64 LOGDEBUG bool GOGC int ORIGIN string DEBUGADDR string LA bool TIMJSON string KEYSTORE string SEP_BIN = byte(131) SEP_STR = "|" Stat istat Conf *ConfBean Bind string DBtype byte DefaultAccount = [2]string{"admin", "123"} MaskSeed = Int64ToBytes(int64(1 << 60)) WEBADMINADDR = fmt.Sprint(6 << 10) CSADDR = fmt.Sprint(7 << 10) IMADDR = 5 << 10 InaccurateTime = time.Now().UnixNano() PINGTO = int64(500) ConnectTimeout = 10 * time.Second WaitTimeout = 10 * time.Second MaxTransLength = 10 * MB DeviceLimit = 1 DeviceTypeLimit = 1 MaxBackup = 3 NodeMaxlength = 64 ForBitIfaceMap *Map[TIMTYPE, int8] OpenSSL = &openssl{} )
View Source
var ERR_ACCOUNT = err(4106, "account incorrect")
View Source
var ERR_AUTH = err(4105, "limited authority")
View Source
var ERR_BIGDATA = err(4114, "big data error")
View Source
var ERR_BLOCK = err(4110, "blocked object")
View Source
var ERR_BLOCKHANDLE = err(5102, "blocking operation")
View Source
var ERR_CANCEL = err(4108, "must not be a cancle object")
View Source
var ERR_DATABASE = err(5103, "database error")
View Source
var ERR_EXPIREOP = err(4103, "expire operate")
View Source
var ERR_FORMAT = err(4113, "format error")
View Source
var ERR_HASEXIST = err(4101, "has exist")
View Source
var ERR_INTERFACE = err(4107, "interface incorrect")
View Source
var ERR_MODIFYAUTH = err(4112, "modify password failed")
View Source
var ERR_NOEXIST = err(4109, "must not be a no exist object")
View Source
var ERR_NOPASS = err(4102, "no pass")
View Source
var ERR_OVERENTRY = err(4111, "over entry")
View Source
var ERR_OVERHZ = err(5105, "freq out of limit")
View Source
var ERR_OVERLOAD = err(5104, "heavy server load")
View Source
var ERR_OVERTIME = err(1102, "overtime")
View Source
var ERR_PARAMS = err(4104, "parameter incorrect")
View Source
var ERR_PING = err(4116, "error ping count")
View Source
var ERR_TOKEN = err(4115, "error token")
View Source
var ERR_UNDEFINED = err(5101, "undefined error")
View Source
var ERR_UUID_REUSE = err(1101, "uuid reuse")
Functions ¶
func UseDefaultDB ¶
func UseDefaultDB() bool
func UseTldbExtent ¶
func UseTldbExtent() bool
Types ¶
type ConfBean ¶
type ConfBean struct { Seed int64 `json:"seed"` Salt string `json:"salt"` Tldb *tldb `json:"tldb"` TldbExtent []*tldb `json:"tldb.extent"` Property *property `json:"sql.property"` Security *security `json:"security"` Notice *notice `json:"notice"` NoDBAuth *noDBAuth `json:"nodbauth"` Listen int `json:"im.listen"` Ssl_crt string `json:"ssl_certificate"` Ssl_crt_key string `json:"ssl_certificate_key"` ConnectLimit int64 `json:"connectLimit"` Memlimit int `json:"memlimit"` MaxMessageSize int `json:"maxmessagesize"` Public string `json:"public.node"` CacheExpireTime int `json:"cache.expiretime"` Pwd string `json:"cluser.pwd"` NodeMaxlength *int `json:"node.maxlength"` EncryptKey string `json:"cluser.encryptkey"` ClusListen string `json:"cluser.listen"` AdminListen string `json:"admin.listen"` AdminTls bool `json:"admin.tls"` Init bool `json:"init"` Bind *string `json:"bind"` PingTo int64 `json:"ping.timeout"` Keystore *string `json:"keystore"` MaxBackup *int `json:"maxbackup"` TaskLimit *int `json:"tasklimit"` DeviceLimit int `json:"device.limit"` DevicetypeLimit int `json:"devicetype.limit"` MessageNoauth bool `json:"message.noauth"` PresenceOfflineBlock bool `json:"presence.offline.block"` }
type RemoteNode ¶
type TIMTYPE ¶
type TIMTYPE byte
const ( TIMEX TIMTYPE = 0 TIMACK TIMTYPE = 12 TIMPING TIMTYPE = 13 TIMREGISTER TIMTYPE = 14 TIMTOKEN TIMTYPE = 15 TIMAUTH TIMTYPE = 16 TIMOFFLINEMSG TIMTYPE = 17 TIMOFFLINEMSGEND TIMTYPE = 18 TIMBROADPRESENCE TIMTYPE = 19 TIMLOGOUT TIMTYPE = 20 TIMPULLMESSAGE TIMTYPE = 21 TIMVROOM TIMTYPE = 22 TIMBUSINESS TIMTYPE = 41 TIMNODES TIMTYPE = 42 TIMMESSAGE TIMTYPE = 90 TIMPRESENCE TIMTYPE = 91 TIMREVOKEMESSAGE TIMTYPE = 92 TIMBURNMESSAGE TIMTYPE = 93 TIMSTREAM TIMTYPE = 94 TIMBIGSTRING TIMTYPE = 95 TIMBIGBINARY TIMTYPE = 96 TIMBIGBINARYSTREAM TIMTYPE = 97 )
Click to show internal directories.
Click to hide internal directories.