Documentation
¶
Index ¶
- Constants
- Variables
- type CommonResp
- type EventMsg
- type GetContactUserNameResp
- type GetLoginQrCodeData
- type GetLoginQrCodeResp
- type GetRoomMemberResp
- type GetRoomMemberRespData
- type GetUserResp
- type GetUserRespData
- type LoginEventData
- type LogoutEventData
- type MsgEventData
- type MsgHandlerProtocolType
- type MsgType
- type Robot
- type RoomMember
- type SearchResp
- type SendTextResp
- type User
- type WinApi
- func (w *WinApi) AddMsgHandler(protocolType MsgHandlerProtocolType, url string) error
- func (w *WinApi) BatchGetUser(userIDs []string) (*GetUserResp, error)
- func (w *WinApi) GetLoginQrCode() (*GetLoginQrCodeResp, error)
- func (w *WinApi) GetRoomMember(roomID string) (*GetRoomMemberResp, error)
- func (w *WinApi) GetSavedFriendUserNames() ([]string, error)
- func (w *WinApi) GetSavedFriendUsers() ([]*User, error)
- func (w *WinApi) GetSavedRoomUserNames() ([]string, error)
- func (w *WinApi) GetSavedRoomUsers() ([]*User, error)
- func (w *WinApi) GetUser(userIDs []string) (*GetUserResp, error)
- func (w *WinApi) SearchUser(userIDs []string) (*SearchResp, error)
- func (w *WinApi) SendText(userName string, text string, atUserList []string) (*SendTextResp, error)
- func (w *WinApi) SendURL(userName string, content string) (*SendTextResp, error)
Constants ¶
View Source
const ( AsyncRespPushType = 0 SyncMsgPushType = 1 LoginMsgPushType = 2 LogoutMsgPushType = 3 MsgHookPushType = 4 RoomChangeMsgPushType = 5 )
View Source
const ( WaitScanLoginState = 0 ScannedLoginState = 1 ConfirmedLoginState = 2 )
View Source
const ( ScanLoginStep = 0 LoggedStep = 1 )
Variables ¶
View Source
var ErrIsLogin = fmt.Errorf("client is already logined")
Functions ¶
This section is empty.
Types ¶
type CommonResp ¶
type CommonResp struct { Description string `json:"description"` ErrorCode int `json:"error_code"` Robot *Robot `json:"robot"` Type int `json:"type"` }
func (*CommonResp) Error ¶
func (c *CommonResp) Error() error
func (*CommonResp) IsSuccess ¶
func (c *CommonResp) IsSuccess() bool
type EventMsg ¶
type GetContactUserNameResp ¶
type GetContactUserNameResp struct { Data struct { Data []*User `json:"data"` Desc string `json:"desc"` Status int `json:"status"` } `json:"data"` CommonResp }
type GetLoginQrCodeData ¶
type GetLoginQrCodeResp ¶
type GetLoginQrCodeResp struct { Data GetLoginQrCodeData `json:"data"` CommonResp }
func (*GetLoginQrCodeResp) IsLogin ¶
func (g *GetLoginQrCodeResp) IsLogin() bool
type GetRoomMemberResp ¶
type GetRoomMemberResp struct { Data struct { Data *GetRoomMemberRespData `json:"data"` Desc string `json:"desc"` Status int `json:"status"` } `json:"data"` CommonResp }
type GetRoomMemberRespData ¶
type GetRoomMemberRespData struct { ChatroomAdminUserNames []string `json:"chatroomAdminUserNames"` ChatroomMemberInfoVerion int `json:"chatroomMemberInfoVerion"` ChatroomUserName string `json:"chatroomUserName"` Count int `json:"count"` Members []*RoomMember `json:"members"` OwnerUserName string `json:"ownerUserName"` }
type GetUserResp ¶
type GetUserResp struct { Data struct { Data *GetUserRespData `json:"data"` Desc string `json:"desc"` Status int `json:"status"` } `json:"data"` CommonResp }
type GetUserRespData ¶
type LoginEventData ¶
type LoginEventData struct { Alias string `json:"alias"` BigHeadImgUrl string `json:"bigHeadImgUrl"` City string `json:"city"` Nation string `json:"nation"` NickName string `json:"nickName"` Phone string `json:"phone"` Province string `json:"province"` Sex int `json:"sex"` Signature string `json:"signature"` SmallHeadImgUrl string `json:"smallHeadImgUrl"` Step int `json:"step"` State int `json:"state"` Uuid string `json:"uuid"` Uin int `json:"uin"` UserName string `json:"userName"` }
type LogoutEventData ¶
type MsgEventData ¶
type MsgEventData struct { ChatroomMemberInfo struct { Alias string `json:"alias"` BelongChatroomNickName string `json:"belongChatroomNickName"` BelongChatroomSmallHeadImgUrl string `json:"belongChatroomSmallHeadImgUrl"` BelongChatroomUserName string `json:"belongChatroomUserName"` ChatroomDisplayName string `json:"chatroomDisplayName"` ChatroomUserFlag int `json:"chatroomUserFlag"` IsChatroomAdmin bool `json:"isChatroomAdmin"` IsChatroomOwner bool `json:"isChatroomOwner"` NickName string `json:"nickName"` Remark string `json:"remark"` SmallHeadImgUrl string `json:"smallHeadImgUrl"` Type string `json:"type"` UserName string `json:"userName"` VerifyFlag string `json:"verifyFlag"` } `json:"chatroomMemberInfo"` Content string `json:"content"` Createtime int `json:"createtime"` From string `json:"from"` IsChatroomMsg int `json:"isChatroomMsg"` IsSender int `json:"isSender"` MsgSvrID int64 `json:"msgSvrID"` Reserved1 string `json:"reserved1"` SyncFromMobile bool `json:"syncFromMobile"` TalkerInfo struct { Alias string `json:"alias"` NickName string `json:"nickName"` Remark string `json:"remark"` SmallHeadImgUrl string `json:"smallHeadImgUrl"` Type string `json:"type"` UserName string `json:"userName"` VerifyFlag string `json:"verifyFlag"` } `json:"talkerInfo"` To string `json:"to"` Type MsgType `json:"type"` }
type MsgHandlerProtocolType ¶
type MsgHandlerProtocolType int
const ( TcpProtocolType MsgHandlerProtocolType = 1 HttpProtocolType MsgHandlerProtocolType = 2 WebsocketProtocolType MsgHandlerProtocolType = 3 )
type MsgType ¶
type MsgType int
const ( MsgTypeText MsgType = 1 MsgTypeImage MsgType = 3 MsgTypeAudio MsgType = 34 MsgTypeFriendVerification MsgType = 37 MsgTypeFriendRecommend MsgType = 42 MsgTypeEmoticon MsgType = 47 MsgTypeLocation MsgType = 48 MsgTypeXML MsgType = 49 MsgTypeTelephone MsgType = 50 MsgTypeMobileOperate MsgType = 51 MsgTypeSystem MsgType = 10000 MsgTypeRecall MsgType = 10002 )
type RoomMember ¶
type RoomMember struct { BigHeadImgUrl string `json:"bigHeadImgUrl"` InviterUserName string `json:"inviterUserName"` IsAdmin bool `json:"isAdmin"` MemberTraceBack string `json:"memberTraceBack"` NickName string `json:"nickName"` Permission int `json:"permission"` SmallHeadImgUrl string `json:"smallHeadImgUrl"` UserName string `json:"userName"` }
type SearchResp ¶
type SearchResp struct { Data struct { Data map[string]*User `json:"data"` Desc string `json:"desc"` Status int `json:"status"` } `json:"data"` CommonResp }
type SendTextResp ¶
type SendTextResp struct { Data struct { Desc string `json:"desc"` MsgSvrID int64 `json:"msgSvrID"` Status int `json:"status"` } `json:"data"` CommonResp }
type User ¶
type User struct { Alias string `json:"alias"` BigHeadImgUrl string `json:"bigHeadImgUrl"` CertFlag int `json:"certFlag"` City string `json:"city"` ErrorCode int `json:"errorCode"` Fullpy string `json:"fullpy"` Nation string `json:"nation"` NickName string `json:"nickName"` Province string `json:"province"` Remark string `json:"remark"` Reserved1 int `json:"reserved1"` Sex int `json:"sex"` Simplepy string `json:"simplepy"` SmallHeadImgUrl string `json:"smallHeadImgUrl"` UserFlag int `json:"userFlag"` UserName string `json:"userName"` ChatroomAccessType int `json:"chatroomAccessType"` ChatroomMaxCount int `json:"chatroomMaxCount"` ChatroomNotify int `json:"chatroomNotify"` IsFriend bool `json:"-"` MemberNum int `json:"-"` OwnerID string `json:"-"` MemberList []*User `json:"-"` AdminIDs []string `json:"-"` }
func (*User) CloneContact ¶
type WinApi ¶
type WinApi struct {
// contains filtered or unexported fields
}
func (*WinApi) AddMsgHandler ¶
func (w *WinApi) AddMsgHandler(protocolType MsgHandlerProtocolType, url string) error
func (*WinApi) BatchGetUser ¶
func (w *WinApi) BatchGetUser(userIDs []string) (*GetUserResp, error)
func (*WinApi) GetLoginQrCode ¶
func (w *WinApi) GetLoginQrCode() (*GetLoginQrCodeResp, error)
func (*WinApi) GetRoomMember ¶
func (w *WinApi) GetRoomMember(roomID string) (*GetRoomMemberResp, error)
func (*WinApi) GetSavedFriendUserNames ¶
GetSavedFriendUserNames 获取通讯录好友
func (*WinApi) GetSavedFriendUsers ¶
func (*WinApi) GetSavedRoomUserNames ¶
GetSavedRoomUserNames 获取通讯录群聊
func (*WinApi) GetSavedRoomUsers ¶
func (*WinApi) SearchUser ¶
func (w *WinApi) SearchUser(userIDs []string) (*SearchResp, error)
SearchUser 好友、群、群成员
Click to show internal directories.
Click to hide internal directories.