Documentation ¶
Index ¶
- Constants
- Variables
- func ConnectUniversal(cli *client.QQClient)
- func DestoryInstance(uin uint, key string)
- func EmptyText() *message.TextElement
- func Energy(uin uint64, id string, appVersion string, salt []byte) ([]byte, error)
- func GetCSRFToken(c *client.QQClient) int
- func GetCookiesWithDomain(c *client.QQClient, domain string) string
- func HandleDeleteMsg(cli *client.QQClient, req *onebot.DeleteMsgReq) *onebot.DeleteMsgResp
- func HandleEventFrame(cli *client.QQClient, eventFrame *onebot.Frame)
- func HandleGetCSRFToken(cli *client.QQClient, req *onebot.GetCsrfTokenReq) *onebot.GetCsrfTokenResp
- func HandleGetCookies(cli *client.QQClient, req *onebot.GetCookiesReq) *onebot.GetCookiesResp
- func HandleGetFriendList(cli *client.QQClient, req *onebot.GetFriendListReq) *onebot.GetFriendListResp
- func HandleGetGroupInfo(cli *client.QQClient, req *onebot.GetGroupInfoReq) *onebot.GetGroupInfoResp
- func HandleGetGroupList(cli *client.QQClient, req *onebot.GetGroupListReq) *onebot.GetGroupListResp
- func HandleGetGroupMemberInfo(cli *client.QQClient, req *onebot.GetGroupMemberInfoReq) *onebot.GetGroupMemberInfoResp
- func HandleGetGroupMemberList(cli *client.QQClient, req *onebot.GetGroupMemberListReq) *onebot.GetGroupMemberListResp
- func HandleGetLoginInfo(cli *client.QQClient, req *onebot.GetLoginInfoReq) *onebot.GetLoginInfoResp
- func HandleGetMsg(cli *client.QQClient, req *onebot.GetMsgReq) *onebot.GetMsgResp
- func HandleGetStrangerInfo(cli *client.QQClient, req *onebot.GetStrangerInfoReq) *onebot.GetStrangerInfoResp
- func HandleSendChannelMsg(cli *client.QQClient, req *onebot.SendChannelMsgReq) *onebot.SendChannelMsgResp
- func HandleSendFriendPoke(cli *client.QQClient, req *onebot.SendFriendPokeReq) *onebot.SendFriendPokeResp
- func HandleSendGroupMsg(cli *client.QQClient, req *onebot.SendGroupMsgReq) *onebot.SendGroupMsgResp
- func HandleSendGroupPoke(cli *client.QQClient, req *onebot.SendGroupPokeReq) *onebot.SendGroupPokeResp
- func HandleSendMsg(cli *client.QQClient, req *onebot.SendMsgReq) *onebot.SendMsgResp
- func HandleSendMusic(cli *client.QQClient, req *onebot.SendMusicReq) *onebot.SendMusicResp
- func HandleSendPrivateMsg(cli *client.QQClient, req *onebot.SendPrivateMsgReq) *onebot.SendPrivateMsgResp
- func HandleSetFriendAddRequest(cli *client.QQClient, req *onebot.SetFriendAddRequestReq) *onebot.SetFriendAddRequestResp
- func HandleSetGroupAddRequest(cli *client.QQClient, req *onebot.SetGroupAddRequestReq) *onebot.SetGroupAddRequestResp
- func HandleSetGroupBan(cli *client.QQClient, req *onebot.SetGroupBanReq) *onebot.SetGroupBanResp
- func HandleSetGroupCard(cli *client.QQClient, req *onebot.SetGroupCardReq) *onebot.SetGroupCardResp
- func HandleSetGroupKick(cli *client.QQClient, req *onebot.SetGroupKickReq) *onebot.SetGroupKickResp
- func HandleSetGroupLeave(cli *client.QQClient, req *onebot.SetGroupLeaveReq) *onebot.SetGroupLeaveResp
- func HandleSetGroupName(cli *client.QQClient, req *onebot.SetGroupNameReq) *onebot.SetGroupNameResp
- func HandleSetGroupSignIn(cli *client.QQClient, req *onebot.SetGroupSignInReq) *onebot.SetGroupSignInResp
- func HandleSetGroupSpecialTitle(cli *client.QQClient, req *onebot.SetGroupSpecialTitleReq) *onebot.SetGroupSpecialTitleResp
- func HandleSetGroupWholeBan(cli *client.QQClient, req *onebot.SetGroupWholeBanReq) *onebot.SetGroupWholeBanResp
- func InitLog(cli *client.QQClient)
- func IsClientExist(uin int64) bool
- func Login(cli *client.QQClient) (bool, error)
- func MiraiAtToProtoAt(elem *message.AtElement) *onebot.Message
- func MiraiDiceToProtoDice(elem *message.DiceElement) *onebot.Message
- func MiraiFaceToProtoFace(elem *message.FaceElement) *onebot.Message
- func MiraiFingerGuessingToProtoFingerGuessing(elem *message.FingerGuessingElement) *onebot.Message
- func MiraiForwardToProtoForward(cli *client.QQClient, elem *message.ForwardElement) *onebot.Message
- func MiraiFriendImageToProtoImage(elem *message.FriendImageElement) *onebot.Message
- func MiraiGroupImageToProtoImage(elem *message.GroupImageElement) *onebot.Message
- func MiraiGuildImageToProtoImage(elem *message.GuildImageElement) *onebot.Message
- func MiraiLightAppToProtoLightApp(elem *message.LightAppElement) *onebot.Message
- func MiraiLocalImageToProtoImage(elem *clz.LocalImageElement) *onebot.Message
- func MiraiMsgToProtoMsg(cli *client.QQClient, messageChain []message.IMessageElement) []*onebot.Message
- func MiraiMsgToRawMsg(cli *client.QQClient, messageChain []message.IMessageElement) string
- func MiraiReplyToProtoReply(cli *client.QQClient, elem *message.ReplyElement) *onebot.Message
- func MiraiServiceToProtoService(elem *message.ServiceElement) *onebot.Message
- func MiraiTextToProtoText(elem *message.TextElement) *onebot.Message
- func MiraiVideoToProtoVideo(cli *client.QQClient, elem *message.ShortVideoElement) *onebot.Message
- func MiraiVoiceToProtoVoice(elem *message.VoiceElement) *onebot.Message
- func OnWsRecvMessage(cli *client.QQClient, plugin *config.Plugin) func(ws *safe_ws.SafeWebSocket, messageType int, data []byte)
- func PathExists(path string) bool
- func ProcessLoginRsp(cli *client.QQClient, rsp *client.LoginResponse) (bool, error)
- func ProtoAtToMiraiAt(data map[string]string) message.IMessageElement
- func ProtoDiceToMiraiDice(data map[string]string) message.IMessageElement
- func ProtoFaceToMiraiFace(data map[string]string) message.IMessageElement
- func ProtoFingerGuessingToMiraiFingerGuessing(data map[string]string) message.IMessageElement
- func ProtoGuildImageToMiraiGuildImage(data map[string]string) message.IMessageElement
- func ProtoImageToMiraiImage(data map[string]string) message.IMessageElement
- func ProtoLightAppToMiraiLightApp(data map[string]string) message.IMessageElement
- func ProtoMsgToMiraiMsg(cli *client.QQClient, msgList []*onebot.Message, notConvertText bool) []message.IMessageElement
- func ProtoMusicToMiraiMusic(_ *client.QQClient, data map[string]string) (m message.IMessageElement)
- func ProtoPokeToMiraiPoke(data map[string]string) message.IMessageElement
- func ProtoReplyToMiraiReply(data map[string]string) *message.ReplyElement
- func ProtoServiceToMiraiService(data map[string]string) message.IMessageElement
- func ProtoShareToMiraiShare(data map[string]string) message.IMessageElement
- func ProtoSignInToMiraiSignIn(data map[string]string) message.IMessageElement
- func ProtoSleep(data map[string]string)
- func ProtoTextToMiraiText(data map[string]string) message.IMessageElement
- func ProtoTtsToMiraiTts(cli *client.QQClient, data map[string]string) (m message.IMessageElement)
- func ProtoVideoToMiraiVideo(_ *client.QQClient, data map[string]string) (m message.IMessageElement)
- func ProtoVoiceToMiraiVoice(data map[string]string) message.IMessageElement
- func RawMsgToMiraiMsg(cli *client.QQClient, str string) []message.IMessageElement
- func RegisterSign(uin uint64, androidId []byte, guid []byte, Qimei36 string, ...)
- func ReleaseClient(cli *client.QQClient)
- func RequestToken(uin uint64)
- func SetRelogin(cli *client.QQClient, retryInterval int, retryCount int)
- func Sign(seq uint64, uin string, cmd string, qua string, buff []byte) (sign []byte, extra []byte, token []byte, err error)
- func SubmitRequestCallback(uin uint64, cmd string, callbackId int, buffer []byte)
- func TTIR(uin uint64)
- type CaptchaMap
- func (m *CaptchaMap) Delete(key int64)
- func (m *CaptchaMap) Load(key int64) (value *WaitingCaptcha, ok bool)
- func (m *CaptchaMap) LoadAndDelete(key int64) (value *WaitingCaptcha, loaded bool)
- func (m *CaptchaMap) LoadOrStore(key int64, value *WaitingCaptcha) (actual *WaitingCaptcha, loaded bool)
- func (m *CaptchaMap) Range(f func(key int64, value *WaitingCaptcha) bool)
- func (m *CaptchaMap) Store(key int64, value *WaitingCaptcha)
- type ClientMap
- func (m *ClientMap) Delete(key int64)
- func (m *ClientMap) Load(key int64) (value *client.QQClient, ok bool)
- func (m *ClientMap) LoadAndDelete(key int64) (value *client.QQClient, loaded bool)
- func (m *ClientMap) LoadOrStore(key int64, value *client.QQClient) (actual *client.QQClient, loaded bool)
- func (m *ClientMap) Range(f func(key int64, value *client.QQClient) bool)
- func (m *ClientMap) Store(key int64, value *client.QQClient)
- type GMCLogin
- type Logger
- type Node
- type RemoteMap
- func (m *RemoteMap) Delete(key int64)
- func (m *RemoteMap) Load(key int64) (value map[string]*WsServer, ok bool)
- func (m *RemoteMap) LoadAndDelete(key int64) (value map[string]*WsServer, loaded bool)
- func (m *RemoteMap) LoadOrStore(key int64, value map[string]*WsServer) (actual map[string]*WsServer, loaded bool)
- func (m *RemoteMap) Range(f func(key int64, value map[string]*WsServer) bool)
- func (m *RemoteMap) Store(key int64, value map[string]*WsServer)
- type RequestCallback
- type RequestSignData
- type RequestSignResult
- type SignRegister
- type TokenMap
- func (m *TokenMap) Delete(key int64)
- func (m *TokenMap) Load(key int64) (value []byte, ok bool)
- func (m *TokenMap) LoadAndDelete(key int64) (value []byte, loaded bool)
- func (m *TokenMap) LoadOrStore(key int64, value []byte) (actual []byte, loaded bool)
- func (m *TokenMap) Range(f func(key int64, value []byte) bool)
- func (m *TokenMap) Store(key int64, value []byte)
- type WaitingCaptcha
- type WsServer
Constants ¶
const MAX_TEXT_LENGTH = 80
Variables ¶
var ( Clients ClientMap LoginTokens TokenMap EnergyCount = 0 EnergyStop = false SignCount = 0 SignStop = false RegisterSignCount = 0 RegisterSignStop = false SubmitRequestCallbackCount = 0 SubmitRequestCallbackStop = false RequestTokenCount = 0 RequestTokenStop = false DestoryInstanceCount = 0 DestoryInstanceStop = false RSR RequestSignResult GTL *GMCLogin SR SignRegister IsRequestTokenAgain bool = false TTI_i = 30 )
Functions ¶
func ConnectUniversal ¶
func DestoryInstance ¶
func EmptyText ¶
func EmptyText() *message.TextElement
func GetCSRFToken ¶
func HandleDeleteMsg ¶
func HandleDeleteMsg(cli *client.QQClient, req *onebot.DeleteMsgReq) *onebot.DeleteMsgResp
func HandleGetCSRFToken ¶
func HandleGetCSRFToken(cli *client.QQClient, req *onebot.GetCsrfTokenReq) *onebot.GetCsrfTokenResp
func HandleGetCookies ¶
func HandleGetCookies(cli *client.QQClient, req *onebot.GetCookiesReq) *onebot.GetCookiesResp
func HandleGetFriendList ¶
func HandleGetFriendList(cli *client.QQClient, req *onebot.GetFriendListReq) *onebot.GetFriendListResp
func HandleGetGroupInfo ¶
func HandleGetGroupInfo(cli *client.QQClient, req *onebot.GetGroupInfoReq) *onebot.GetGroupInfoResp
func HandleGetGroupList ¶
func HandleGetGroupList(cli *client.QQClient, req *onebot.GetGroupListReq) *onebot.GetGroupListResp
func HandleGetGroupMemberInfo ¶
func HandleGetGroupMemberInfo(cli *client.QQClient, req *onebot.GetGroupMemberInfoReq) *onebot.GetGroupMemberInfoResp
func HandleGetGroupMemberList ¶
func HandleGetGroupMemberList(cli *client.QQClient, req *onebot.GetGroupMemberListReq) *onebot.GetGroupMemberListResp
func HandleGetLoginInfo ¶
func HandleGetLoginInfo(cli *client.QQClient, req *onebot.GetLoginInfoReq) *onebot.GetLoginInfoResp
func HandleGetMsg ¶
func HandleGetStrangerInfo ¶
func HandleGetStrangerInfo(cli *client.QQClient, req *onebot.GetStrangerInfoReq) *onebot.GetStrangerInfoResp
func HandleSendChannelMsg ¶
func HandleSendChannelMsg(cli *client.QQClient, req *onebot.SendChannelMsgReq) *onebot.SendChannelMsgResp
func HandleSendFriendPoke ¶
func HandleSendFriendPoke(cli *client.QQClient, req *onebot.SendFriendPokeReq) *onebot.SendFriendPokeResp
func HandleSendGroupMsg ¶
func HandleSendGroupMsg(cli *client.QQClient, req *onebot.SendGroupMsgReq) *onebot.SendGroupMsgResp
func HandleSendGroupPoke ¶
func HandleSendGroupPoke(cli *client.QQClient, req *onebot.SendGroupPokeReq) *onebot.SendGroupPokeResp
func HandleSendMsg ¶
func HandleSendMsg(cli *client.QQClient, req *onebot.SendMsgReq) *onebot.SendMsgResp
func HandleSendMusic ¶
func HandleSendMusic(cli *client.QQClient, req *onebot.SendMusicReq) *onebot.SendMusicResp
func HandleSendPrivateMsg ¶
func HandleSendPrivateMsg(cli *client.QQClient, req *onebot.SendPrivateMsgReq) *onebot.SendPrivateMsgResp
func HandleSetFriendAddRequest ¶
func HandleSetFriendAddRequest(cli *client.QQClient, req *onebot.SetFriendAddRequestReq) *onebot.SetFriendAddRequestResp
func HandleSetGroupAddRequest ¶
func HandleSetGroupAddRequest(cli *client.QQClient, req *onebot.SetGroupAddRequestReq) *onebot.SetGroupAddRequestResp
func HandleSetGroupBan ¶
func HandleSetGroupBan(cli *client.QQClient, req *onebot.SetGroupBanReq) *onebot.SetGroupBanResp
func HandleSetGroupCard ¶
func HandleSetGroupCard(cli *client.QQClient, req *onebot.SetGroupCardReq) *onebot.SetGroupCardResp
func HandleSetGroupKick ¶
func HandleSetGroupKick(cli *client.QQClient, req *onebot.SetGroupKickReq) *onebot.SetGroupKickResp
func HandleSetGroupLeave ¶
func HandleSetGroupLeave(cli *client.QQClient, req *onebot.SetGroupLeaveReq) *onebot.SetGroupLeaveResp
func HandleSetGroupName ¶
func HandleSetGroupName(cli *client.QQClient, req *onebot.SetGroupNameReq) *onebot.SetGroupNameResp
func HandleSetGroupSignIn ¶
func HandleSetGroupSignIn(cli *client.QQClient, req *onebot.SetGroupSignInReq) *onebot.SetGroupSignInResp
func HandleSetGroupSpecialTitle ¶
func HandleSetGroupSpecialTitle(cli *client.QQClient, req *onebot.SetGroupSpecialTitleReq) *onebot.SetGroupSpecialTitleResp
func HandleSetGroupWholeBan ¶
func HandleSetGroupWholeBan(cli *client.QQClient, req *onebot.SetGroupWholeBanReq) *onebot.SetGroupWholeBanResp
func IsClientExist ¶
func MiraiDiceToProtoDice ¶
func MiraiDiceToProtoDice(elem *message.DiceElement) *onebot.Message
func MiraiFaceToProtoFace ¶
func MiraiFaceToProtoFace(elem *message.FaceElement) *onebot.Message
func MiraiFingerGuessingToProtoFingerGuessing ¶
func MiraiFingerGuessingToProtoFingerGuessing(elem *message.FingerGuessingElement) *onebot.Message
func MiraiFriendImageToProtoImage ¶
func MiraiFriendImageToProtoImage(elem *message.FriendImageElement) *onebot.Message
func MiraiGroupImageToProtoImage ¶
func MiraiGroupImageToProtoImage(elem *message.GroupImageElement) *onebot.Message
func MiraiGuildImageToProtoImage ¶
func MiraiGuildImageToProtoImage(elem *message.GuildImageElement) *onebot.Message
func MiraiLightAppToProtoLightApp ¶
func MiraiLightAppToProtoLightApp(elem *message.LightAppElement) *onebot.Message
func MiraiLocalImageToProtoImage ¶
func MiraiLocalImageToProtoImage(elem *clz.LocalImageElement) *onebot.Message
func MiraiMsgToProtoMsg ¶
func MiraiMsgToRawMsg ¶
func MiraiMsgToRawMsg(cli *client.QQClient, messageChain []message.IMessageElement) string
func MiraiReplyToProtoReply ¶
func MiraiServiceToProtoService ¶
func MiraiServiceToProtoService(elem *message.ServiceElement) *onebot.Message
func MiraiTextToProtoText ¶
func MiraiTextToProtoText(elem *message.TextElement) *onebot.Message
func MiraiVideoToProtoVideo ¶
func MiraiVoiceToProtoVoice ¶
func MiraiVoiceToProtoVoice(elem *message.VoiceElement) *onebot.Message
func OnWsRecvMessage ¶
func PathExists ¶
func ProcessLoginRsp ¶
func ProtoAtToMiraiAt ¶
func ProtoAtToMiraiAt(data map[string]string) message.IMessageElement
func ProtoDiceToMiraiDice ¶
func ProtoDiceToMiraiDice(data map[string]string) message.IMessageElement
func ProtoFaceToMiraiFace ¶
func ProtoFaceToMiraiFace(data map[string]string) message.IMessageElement
func ProtoFingerGuessingToMiraiFingerGuessing ¶
func ProtoFingerGuessingToMiraiFingerGuessing(data map[string]string) message.IMessageElement
func ProtoGuildImageToMiraiGuildImage ¶
func ProtoGuildImageToMiraiGuildImage(data map[string]string) message.IMessageElement
func ProtoImageToMiraiImage ¶
func ProtoImageToMiraiImage(data map[string]string) message.IMessageElement
func ProtoLightAppToMiraiLightApp ¶
func ProtoLightAppToMiraiLightApp(data map[string]string) message.IMessageElement
func ProtoMsgToMiraiMsg ¶
func ProtoMsgToMiraiMsg(cli *client.QQClient, msgList []*onebot.Message, notConvertText bool) []message.IMessageElement
消息列表,不自动把code变成msg
func ProtoMusicToMiraiMusic ¶
func ProtoPokeToMiraiPoke ¶
func ProtoPokeToMiraiPoke(data map[string]string) message.IMessageElement
func ProtoReplyToMiraiReply ¶
func ProtoReplyToMiraiReply(data map[string]string) *message.ReplyElement
func ProtoServiceToMiraiService ¶
func ProtoServiceToMiraiService(data map[string]string) message.IMessageElement
func ProtoShareToMiraiShare ¶
func ProtoShareToMiraiShare(data map[string]string) message.IMessageElement
func ProtoSignInToMiraiSignIn ¶
func ProtoSignInToMiraiSignIn(data map[string]string) message.IMessageElement
func ProtoSleep ¶
func ProtoTextToMiraiText ¶
func ProtoTextToMiraiText(data map[string]string) message.IMessageElement
func ProtoTtsToMiraiTts ¶
func ProtoVideoToMiraiVideo ¶
func ProtoVoiceToMiraiVoice ¶
func ProtoVoiceToMiraiVoice(data map[string]string) message.IMessageElement
func RawMsgToMiraiMsg ¶
func RawMsgToMiraiMsg(cli *client.QQClient, str string) []message.IMessageElement
func RegisterSign ¶
func RequestToken ¶
func RequestToken(uin uint64)
Types ¶
type CaptchaMap ¶
type CaptchaMap struct {
// contains filtered or unexported fields
}
Map is like a Go map[interface{}]interface{} but is safe for concurrent use by multiple goroutines without additional locking or coordination. Loads, stores, and deletes run in amortized constant time.
The Map type is specialized. Most code should use a plain Go map instead, with separate locking or coordination, for better type safety and to make it easier to maintain other invariants along with the map content.
The Map type is optimized for two common use cases: (1) when the entry for a given key is only ever written once but read many times, as in caches that only grow, or (2) when multiple goroutines read, write, and overwrite entries for disjoint sets of keys. In these two cases, use of a Map may significantly reduce lock contention compared to a Go map paired with a separate Mutex or RWMutex.
The zero Map is empty and ready for use. A Map must not be copied after first use.
var WaitingCaptchas CaptchaMap
TODO sync
func (*CaptchaMap) Delete ¶
func (m *CaptchaMap) Delete(key int64)
Delete deletes the value for a key.
func (*CaptchaMap) Load ¶
func (m *CaptchaMap) Load(key int64) (value *WaitingCaptcha, ok bool)
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*CaptchaMap) LoadAndDelete ¶
func (m *CaptchaMap) LoadAndDelete(key int64) (value *WaitingCaptcha, loaded bool)
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present.
func (*CaptchaMap) LoadOrStore ¶
func (m *CaptchaMap) LoadOrStore(key int64, value *WaitingCaptcha) (actual *WaitingCaptcha, loaded bool)
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored.
func (*CaptchaMap) Range ¶
func (m *CaptchaMap) Range(f func(key int64, value *WaitingCaptcha) bool)
Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
Range may be O(N) with the number of elements in the map even if f returns false after a constant number of calls.
func (*CaptchaMap) Store ¶
func (m *CaptchaMap) Store(key int64, value *WaitingCaptcha)
Store sets the value for a key.
type ClientMap ¶
type ClientMap struct {
// contains filtered or unexported fields
}
Map is like a Go map[interface{}]interface{} but is safe for concurrent use by multiple goroutines without additional locking or coordination. Loads, stores, and deletes run in amortized constant time.
The Map type is specialized. Most code should use a plain Go map instead, with separate locking or coordination, for better type safety and to make it easier to maintain other invariants along with the map content.
The Map type is optimized for two common use cases: (1) when the entry for a given key is only ever written once but read many times, as in caches that only grow, or (2) when multiple goroutines read, write, and overwrite entries for disjoint sets of keys. In these two cases, use of a Map may significantly reduce lock contention compared to a Go map paired with a separate Mutex or RWMutex.
The zero Map is empty and ready for use. A Map must not be copied after first use.
func (*ClientMap) Load ¶
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*ClientMap) LoadAndDelete ¶
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present.
func (*ClientMap) LoadOrStore ¶
func (m *ClientMap) LoadOrStore(key int64, value *client.QQClient) (actual *client.QQClient, loaded bool)
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored.
func (*ClientMap) Range ¶
Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
Range may be O(N) with the number of elements in the map even if f returns false after a constant number of calls.
type GMCLogin ¶
type GMCLogin struct { DeviceSeed int64 ClientProtocol int32 SignServer string SignServerKey string }
func GmcTokenLogin ¶
type RemoteMap ¶
type RemoteMap struct {
// contains filtered or unexported fields
}
Map is like a Go map[interface{}]interface{} but is safe for concurrent use by multiple goroutines without additional locking or coordination. Loads, stores, and deletes run in amortized constant time.
The Map type is specialized. Most code should use a plain Go map instead, with separate locking or coordination, for better type safety and to make it easier to maintain other invariants along with the map content.
The Map type is optimized for two common use cases: (1) when the entry for a given key is only ever written once but read many times, as in caches that only grow, or (2) when multiple goroutines read, write, and overwrite entries for disjoint sets of keys. In these two cases, use of a Map may significantly reduce lock contention compared to a Go map paired with a separate Mutex or RWMutex.
The zero Map is empty and ready for use. A Map must not be copied after first use.
var ( // RemoteServers key是botId,value是map(key是serverName,value是server) RemoteServers RemoteMap )
func (*RemoteMap) Load ¶
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*RemoteMap) LoadAndDelete ¶
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present.
func (*RemoteMap) LoadOrStore ¶
func (m *RemoteMap) LoadOrStore(key int64, value map[string]*WsServer) (actual map[string]*WsServer, loaded bool)
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored.
func (*RemoteMap) Range ¶
Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
Range may be O(N) with the number of elements in the map even if f returns false after a constant number of calls.
type RequestCallback ¶
type RequestSignData ¶
type RequestSignData struct { Token string `json:"token,omitempty"` Extra string `json:"extra,omitempty"` Sign string `json:"sign,omitempty"` O3dId string `json:"o3did,omitempty"` RequestCallback []*RequestCallback }
type RequestSignResult ¶
type RequestSignResult struct { Code int `json:"code,omitempty"` Msg string `json:"msg,omitempty"` Data *RequestSignData }
type SignRegister ¶
func SRI ¶
func SRI() (sr SignRegister, err error)
type TokenMap ¶
type TokenMap struct {
// contains filtered or unexported fields
}
Map is like a Go map[interface{}]interface{} but is safe for concurrent use by multiple goroutines without additional locking or coordination. Loads, stores, and deletes run in amortized constant time.
The Map type is specialized. Most code should use a plain Go map instead, with separate locking or coordination, for better type safety and to make it easier to maintain other invariants along with the map content.
The Map type is optimized for two common use cases: (1) when the entry for a given key is only ever written once but read many times, as in caches that only grow, or (2) when multiple goroutines read, write, and overwrite entries for disjoint sets of keys. In these two cases, use of a Map may significantly reduce lock contention compared to a Go map paired with a separate Mutex or RWMutex.
The zero Map is empty and ready for use. A Map must not be copied after first use.
func (*TokenMap) Load ¶
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*TokenMap) LoadAndDelete ¶
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present.
func (*TokenMap) LoadOrStore ¶
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored.
func (*TokenMap) Range ¶
Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
Range may be O(N) with the number of elements in the map even if f returns false after a constant number of calls.
type WaitingCaptcha ¶
type WaitingCaptcha struct { Captcha *dto.Bot_Captcha Prom *promise.Promise }