Documentation
¶
Index ¶
- Constants
- func JSONFormEncode(v reflect.Value) string
- func RegisterEncoder(value interface{}, encoder func(reflect.Value) string)
- func Request[T any](c *Client, ctx context.Context, param Param) (*T, error)
- type AsError
- type BasicResponse
- type ChatRoomCreateParam
- type ChatRoomCreateResponse
- type ChatRoomInfo
- type ChatRoomMember
- type ChatRoomMemberQueryType
- type ChatRoomMemberType
- type ChatRoomMembersByPageParam
- type ChatRoomMembersByPageResponse
- type ChatRoomMsg
- type ChatRoomRecallParam
- type ChatRoomRecallResponse
- type ChatRoomRequestAddrParam
- type ChatRoomRequestAddrResponse
- type ChatRoomSendMsgParam
- type ChatRoomSendMsgResponse
- type ChatRoomSetMemberRoleBasicInfo
- type ChatRoomSetMemberRoleOptType
- type ChatRoomSetMemberRoleParam
- type ChatRoomSetMemberRoleResponse
- type ChatRoomUpdateInOutNotificationParam
- type ChatRoomUpdateInOutNotificationResponse
- type ChatroomDelayInfo
- type ChatroomGetBatchParam
- type ChatroomGetBatchResponse
- type ChatroomGetParam
- type ChatroomGetResponse
- type Client
- func (c *Client) AddCheckSum(r *http.Request)
- func (c *Client) AddFormBody(r *http.Request, v any) error
- func (c *Client) ChatRoomCreate(ctx context.Context, param *ChatRoomCreateParam) (*ChatRoomCreateResponse, error)
- func (c *Client) ChatRoomMembersByPage(ctx context.Context, param *ChatRoomMembersByPageParam) (*ChatRoomMembersByPageResponse, error)
- func (c *Client) ChatRoomRecall(ctx context.Context, param *ChatRoomRecallParam) (*ChatRoomRecallResponse, error)
- func (c *Client) ChatRoomRequestAddr(ctx context.Context, param *ChatRoomRequestAddrParam) (*ChatRoomRequestAddrResponse, error)
- func (c *Client) ChatRoomSendMsg(ctx context.Context, param *ChatRoomSendMsgParam) (*ChatRoomSendMsgResponse, error)
- func (c *Client) ChatRoomSetMemberRole(ctx context.Context, param *ChatRoomSetMemberRoleParam) (*ChatRoomSetMemberRoleResponse, error)
- func (c *Client) ChatRoomUpdateInOutNotification(ctx context.Context, param *ChatRoomUpdateInOutNotificationParam) (*ChatRoomUpdateInOutNotificationResponse, error)
- func (c *Client) ChatroomGet(ctx context.Context, param *ChatroomGetParam) (*ChatroomGetResponse, error)
- func (c *Client) ChatroomGetBatch(ctx context.Context, param *ChatroomGetBatchParam) (*ChatroomGetBatchResponse, error)
- func (c *Client) FriendAdd(ctx context.Context, param *FriendAddParam) (*FriendAddResponse, error)
- func (c *Client) FriendDelete(ctx context.Context, param *FriendDeleteParam) (*FriendDeleteResponse, error)
- func (c *Client) FriendGet(ctx context.Context, param *FriendGetParam) (*FriendGetResponse, error)
- func (c *Client) FriendUpdate(ctx context.Context, param *FriendUpdateParam) (*FriendUpdateResponse, error)
- func (c *Client) GetUserInfos(ctx context.Context, param *GetUserInfosParam) (*GetUserInfosResponse, error)
- func (c *Client) JSONResponse(resp *http.Response, outPtr any) error
- func (c *Client) MsgDelMsg(ctx context.Context, param *MsgDelMsgParam) (*MsgDelMsgResponse, error)
- func (c *Client) PostForm(ctx context.Context, path string, value any) (*http.Response, error)
- func (c *Client) SignACCIDToken(accid string, TTLSecond int) string
- func (c *Client) URL(path string) string
- func (c *Client) UserBlock(ctx context.Context, param *UserBlockParam) (*UserBlockResponse, error)
- func (c *Client) UserCreate(ctx context.Context, param *UserCreateParam) (*UserCreateResponse, error)
- func (c *Client) UserListBlackAndMuteList(ctx context.Context, param *UserListBlackAndMuteListParam) (*UserListBlackAndMuteListResponse, error)
- func (c *Client) UserMute(ctx context.Context, param *UserMuteParam) (*UserMuteResponse, error)
- func (c *Client) UserRefreshToken(ctx context.Context, param *UserRefreshTokenParam) (*UserRefreshTokenResponse, error)
- func (c *Client) UserSetDonnop(ctx context.Context, param *UserSetDonnopParam) (*UserSetDonnopResponse, error)
- func (c *Client) UserSetSpecialRelation(ctx context.Context, param *UserSetSpecialRelationParam) (*UserSetSpecialRelationResponse, error)
- func (c *Client) UserUnBlock(ctx context.Context, param *UserUnBlockParam) (*UserUnBlockResponse, error)
- func (c *Client) UserUpdate(ctx context.Context, param *UserUpdateParam) (*UserUpdateResponse, error)
- func (c *Client) UserUpdateUserInfo(ctx context.Context, param *UserUpdateUserInfoParam) (*UserUpdateUserInfoResponse, error)
- type ClientType
- type CreateUserInfo
- type DelayClosePolicy
- type DeleteMsgType
- type FriendAddParam
- type FriendAddResponse
- type FriendAddType
- type FriendDeleteParam
- type FriendDeleteResponse
- type FriendGetParam
- type FriendGetResponse
- type FriendInfo
- type FriendUpdateParam
- type FriendUpdateResponse
- type GetUserInfosParam
- type GetUserInfosResponse
- type Logger
- type MillsSecond
- type MsgDelMsgParam
- type MsgDelMsgResponse
- type MsgType
- type Option
- type Param
- type QueueLevel
- type RawBodyModel
- type RefreshTokenInfo
- type RelationType
- type StringSlice
- type UserBlockParam
- type UserBlockResponse
- type UserCreateParam
- type UserCreateResponse
- type UserInfo
- type UserListBlackAndMuteListParam
- type UserListBlackAndMuteListResponse
- type UserMuteParam
- type UserMuteResponse
- type UserRefreshTokenParam
- type UserRefreshTokenResponse
- type UserSetDonnopParam
- type UserSetDonnopResponse
- type UserSetSpecialRelationParam
- type UserSetSpecialRelationResponse
- type UserUnBlockParam
- type UserUnBlockResponse
- type UserUpdateParam
- type UserUpdateResponse
- type UserUpdateUserInfoParam
- type UserUpdateUserInfoResponse
- type WithRawBody
- type YunxinError
Constants ¶
View Source
const ( HTTPAppKey = "AppKey" HTTPNonce = "Nonce" HTTPCurTime = "CurTime" HTTPCheckSum = "CheckSum" HTTPContentType = "Content-Type" HTTPXFormURLEncoded = "application/x-www-form-urlencoded;charset=utf-8" )
View Source
const ( ClientTypeWeblink = 1 ClientTypeCommonlink = 2 ClientTypeWechatlink = 3 )
View Source
const ( PathUserCreate = `/user/create.action` PathUserUpdate = `/user/update.action` PathUserRefreshToken = `/user/refreshToken.action` PathUserBlock = `/user/block.action` PathUserUnBlock = `/user/unblock.action` PathUserUpdateUserInfo = `/user/updateUinfo.action` PathGetUserInfos = `/user/getUinfos.action` PathUserSetDonnop = `/user/setDonnop.action` PathUserMute = `/user/mute.action` PathFriendAdd = `/friend/add.action` PathFriendUpdate = `/friend/update.action` PathFriendDelete = `/friend/delete.action` PathFriendGet = `/friend/get.action` PathUserSetSpecialRelation = `/user/setSpecialRelation.action` PathUserListBlackAndMuteList = `/user/listBlackAndMuteList.action` PathMsgSendMsg = `/msg/sendMsg.action` PathMsgDelMsg = `/msg/delMsg.action` PathChatRoomCreate = `/chatroom/create.action` PathChatroomGet = `/chatroom/get.action` PathChatroomGetBatch = `/chatroom/getBatch.action` PathChatRoomRequestAddr = `/chatroom/requestAddr.action` PathChatRoomSendMsg = `/chatroom/sendMsg.action` PathChatRoomMembersByPage = `/chatroom/membersByPage.action` PathChatRoomSetMemberRole = `/chatroom/setMemberRole.action` PathChatRoomRecall = `/chatroom/recall.action` PathChatRoomUpdateInOutNotification = `/chatroom/updateInOutNotification.action` )
View Source
const DefaultHost = "https://api.netease.im/nimserver"
Variables ¶
This section is empty.
Functions ¶
func JSONFormEncode ¶
func RegisterEncoder ¶
Types ¶
type BasicResponse ¶
type BasicResponse struct {
RawBodyModel
Code int `json:"code"`
Desc string `json:"desc,omitempty"` // Error description
}
func (BasicResponse) AsError ¶ added in v0.0.2
func (r BasicResponse) AsError() error
func (*BasicResponse) IsSuccess ¶
func (r *BasicResponse) IsSuccess() bool
type ChatRoomCreateParam ¶
type ChatRoomCreateParam struct {
Creator string `schema:"creator,required"`
Name string `schema:"name,required"`
Announcement string `schema:"announcement"`
BroadcastURL string `schema:"broadcasturl"`
Ext string `schema:"ext"`
QueueLevel QueueLevel `schema:"queuelevel"`
Bid string `schema:"bid"` // TODO json string
DelayClosePolicy DelayClosePolicy `schema:"delayClosePolicy"`
DelaySeconds int64 `schema:"delaySeconds"`
}
func (ChatRoomCreateParam) GetPath ¶
func (ChatRoomCreateParam) GetPath() string
type ChatRoomCreateResponse ¶
type ChatRoomCreateResponse struct {
BasicResponse
ChatRoom *ChatRoomInfo `json:"chatroom"`
}
type ChatRoomInfo ¶
type ChatRoomInfo struct {
RoomID int64 `json:"roomid"`
Valid bool `json:"valid"`
Announcement *string `json:"announcement"`
Name string `json:"name"`
Broadcasturl string `json:"broadcasturl"`
Ext string `json:"ext"`
QueueLevel QueueLevel `json:"queuelevel"`
Muted bool `json:"muted"`
Creator string `json:"creator"`
DelayInfo ChatroomDelayInfo `json:"delayInfo"`
Onlineusercount *int `json:"onlineusercount,omitempty"`
IOnotify *bool `json:"ionotify,omitempty"`
}
type ChatRoomMember ¶ added in v0.0.2
type ChatRoomMember struct {
RoomID int64 `json:"roomid"`
AccID string `json:"accid"`
Nick string `json:"nick"`
Avator string `json:"avator"`
Ext string `json:"ext"`
Type ChatRoomMemberType `json:"type"`
Level int `json:"level"`
OnlineStat bool `json:"onlineStat"`
EnterTime MillsSecond `json:"enterTime"`
Blacklisted bool `json:"blacklisted"`
Muted bool `json:"muted"`
TempMuted bool `json:"tempMuted"`
TempMuteTTL int `json:"tempMuteTtl"`
IsRobot bool `json:"isRobot"`
RobotExpirAt int `json:"robotExpirAt"`
}
type ChatRoomMemberQueryType ¶ added in v0.0.2
type ChatRoomMemberQueryType int
const ( ChatRoomMemberQueryTypeDefault ChatRoomMemberQueryType = 0 ChatRoomMemberQueryTypeTemp ChatRoomMemberQueryType = 1 ChatRoomMemberQueryTypeOnline ChatRoomMemberQueryType = 2 )
type ChatRoomMemberType ¶ added in v0.0.2
type ChatRoomMemberType string
const ( ChatRoomMemberTypeUnset ChatRoomMemberType = "UNSET" ChatRoomMemberTypeLimited ChatRoomMemberType = "LIMITED" ChatRoomMemberTypeCommon ChatRoomMemberType = "COMMON" ChatRoomMemberTypeCreator ChatRoomMemberType = "CREATOR" ChatRoomMemberTypeManager ChatRoomMemberType = "MANAGER" ChatRoomMemberTypeTemporary ChatRoomMemberType = "TEMPORARY" )
type ChatRoomMembersByPageParam ¶ added in v0.0.2
type ChatRoomMembersByPageParam struct {
RoomID int64 `schema:"roomid,required"`
Type ChatRoomMemberQueryType `schema:"type,required"`
EndTime MillsSecond `schema:"endtime,required"`
Limit int64 `schema:"limit,required"` // <=100
}
func (ChatRoomMembersByPageParam) GetPath ¶ added in v0.0.2
func (ChatRoomMembersByPageParam) GetPath() string
type ChatRoomMembersByPageResponse ¶ added in v0.0.2
type ChatRoomMembersByPageResponse struct {
BasicResponse
Desc struct {
Data []*ChatRoomMember `json:"data"`
} `json:"desc"`
}
type ChatRoomMsg ¶ added in v0.0.2
type ChatRoomMsg struct {
Time string `json:"time"`
FromAccount string `json:"fromAccount"`
FromNick string `json:"fromNick"`
FromAvator string `json:"fromAvator"`
MsgIDClient string `json:"msgid_client"`
FromClientType string `json:"fromClientType"`
Attach string `json:"attach"`
RoomID string `json:"roomId"`
Type string `json:"type"`
Ext string `json:"ext"`
HighPriorityFlag int `json:"highPriorityFlag"`
MsgAbandonFlag int `json:"msgAbandonFlag"`
}
type ChatRoomRecallParam ¶ added in v0.0.2
type ChatRoomRecallParam struct {
RoomID int64 `schema:"roomid,required"`
FromAccID string `schema:"fromAcc,required"`
MsgID string `schema:"msgId,required"`
OperatorAccID string `schema:"operatorAcc,required"` // 消息撤回的操作者accid
NotifyExt string `schema:"notifyExt"` // json
MsgTimetag int64 `schema:"msgTimetag,required"` // 被撤回消息的时间戳(单位:毫秒)
}
func (ChatRoomRecallParam) GetPath ¶ added in v0.0.2
func (ChatRoomRecallParam) GetPath() string
type ChatRoomRecallResponse ¶ added in v0.0.2
type ChatRoomRecallResponse struct {
BasicResponse
}
type ChatRoomRequestAddrParam ¶ added in v0.0.2
type ChatRoomRequestAddrParam struct {
RoomID int64 `schema:"roomid,required"`
AccID string `schema:"accid,required"`
ClientType ClientType `schema:"clienttype"`
ClientIP string `schema:"clientip"`
}
func (ChatRoomRequestAddrParam) GetPath ¶ added in v0.0.2
func (ChatRoomRequestAddrParam) GetPath() string
type ChatRoomRequestAddrResponse ¶ added in v0.0.2
type ChatRoomRequestAddrResponse struct {
BasicResponse
Addr []string `json:"addr"`
}
type ChatRoomSendMsgParam ¶ added in v0.0.2
type ChatRoomSendMsgParam struct {
RoomID int64 `schema:"roomid,required"`
MsgID string `schema:"msgId,required"`
FromAccID string `schema:"fromAccid,required"`
MsgType MsgType `schema:"msgType"`
SubType int `schema:"subType"`
ResendFlag int `schema:"resendFlag"`
Attach string `schema:"attach"`
Ext string `schema:"ext"`
SkipHistory int `schema:"skipHistory"`
AbandonRatio int `schema:"abandonRatio"`
HighPriority bool `schema:"highPriority"`
NeedHighPriorityMsgResend bool `schema:"needHighPriorityMsgResend"`
UseYidun int `schema:"useYidun"`
YidunAntiCheating string `schema:"yidunAntiCheating"`
YidunAntiSpamExt string `schema:"yidunAntiSpamExt"`
Bid string `schema:"bid"`
Antispam string `schema:"antispam"`
NotifyTargetTags string `schema:"notifyTargetTags"`
AntispamCustom string `schema:"antispamCustom"`
Env string `schema:"env"`
ChatMsgPriority int `schema:"chatMsgPriority"`
ForbiddenIfHighPriorityMsgFreq int `schema:"forbiddenIfHighPriorityMsgFreq"`
LocX float64 `schema:"locX"`
LocY float64 `schema:"locY"`
LocZ float64 `schema:"locZ"`
}
func (ChatRoomSendMsgParam) GetPath ¶ added in v0.0.2
func (ChatRoomSendMsgParam) GetPath() string
type ChatRoomSendMsgResponse ¶ added in v0.0.2
type ChatRoomSendMsgResponse struct {
BasicResponse
Desc *ChatRoomMsg `json:"desc"`
}
type ChatRoomSetMemberRoleBasicInfo ¶ added in v0.0.2
type ChatRoomSetMemberRoleBasicInfo struct {
RoomID int64 `json:"roomid"`
AccID string `json:"accid"`
Type ChatRoomMemberType `json:"type"`
Level int `json:"level"`
}
type ChatRoomSetMemberRoleOptType ¶ added in v0.0.2
type ChatRoomSetMemberRoleOptType int
const ( ChatRoomSetMemberRoleOptTypeAsAdmin ChatRoomSetMemberRoleOptType = 1 ChatRoomSetMemberRoleOptTypeAsNomal ChatRoomSetMemberRoleOptType = 2 ChatRoomSetMemberRoleOptTypeAsBlock ChatRoomSetMemberRoleOptType = -1 ChatRoomSetMemberRoleOptTypeAsBan ChatRoomSetMemberRoleOptType = -2 )
type ChatRoomSetMemberRoleParam ¶ added in v0.0.2
type ChatRoomSetMemberRoleParam struct {
RoomID int64 `schema:"roomid,required"`
Operator string `schema:"operator,required"`
Target string `schema:"target,required"`
Opt ChatRoomSetMemberRoleOptType `schema:"opt,required"`
OptValue bool `schema:"optvalue,required"`
NotifyExt string `schema:"notifyExt"` // json
}
func (ChatRoomSetMemberRoleParam) GetPath ¶ added in v0.0.2
func (ChatRoomSetMemberRoleParam) GetPath() string
type ChatRoomSetMemberRoleResponse ¶ added in v0.0.2
type ChatRoomSetMemberRoleResponse struct {
BasicResponse
Desc ChatRoomSetMemberRoleBasicInfo `json:"desc"`
}
type ChatRoomUpdateInOutNotificationParam ¶ added in v0.0.4
type ChatRoomUpdateInOutNotificationParam struct {
RoomID int64 `schema:"roomid,required"`
Close bool `schema:"close,required"`
}
func (ChatRoomUpdateInOutNotificationParam) GetPath ¶ added in v0.0.4
func (ChatRoomUpdateInOutNotificationParam) GetPath() string
type ChatRoomUpdateInOutNotificationResponse ¶ added in v0.0.4
type ChatRoomUpdateInOutNotificationResponse struct {
BasicResponse
}
type ChatroomDelayInfo ¶
type ChatroomGetBatchParam ¶ added in v0.0.2
type ChatroomGetBatchParam struct {
RoomIDs StringSlice `schema:"roomids"`
NeedOnlineUserCount bool `schema:"needOnlineUserCount"`
}
func (ChatroomGetBatchParam) GetPath ¶ added in v0.0.2
func (ChatroomGetBatchParam) GetPath() string
type ChatroomGetBatchResponse ¶ added in v0.0.2
type ChatroomGetBatchResponse struct {
BasicResponse
NoExistRooms []int64 `json:"noExistRooms"`
FailRooms []int64 `json:"failRooms"`
SuccRooms []*ChatRoomInfo `json:"succRooms"`
}
type ChatroomGetParam ¶ added in v0.0.2
type ChatroomGetParam struct {
RoomID int64 `schema:"roomid"`
NeedOnlineUserCount bool `schema:"needOnlineUserCount"`
}
func (ChatroomGetParam) GetPath ¶ added in v0.0.2
func (ChatroomGetParam) GetPath() string
type ChatroomGetResponse ¶ added in v0.0.2
type ChatroomGetResponse struct {
BasicResponse
ChatRoom *ChatRoomInfo `json:"chatroom"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddCheckSum ¶
func (*Client) ChatRoomCreate ¶
func (c *Client) ChatRoomCreate(ctx context.Context, param *ChatRoomCreateParam) (*ChatRoomCreateResponse, error)
func (*Client) ChatRoomMembersByPage ¶ added in v0.0.2
func (c *Client) ChatRoomMembersByPage(ctx context.Context, param *ChatRoomMembersByPageParam) (*ChatRoomMembersByPageResponse, error)
func (*Client) ChatRoomRecall ¶ added in v0.0.2
func (c *Client) ChatRoomRecall(ctx context.Context, param *ChatRoomRecallParam) (*ChatRoomRecallResponse, error)
func (*Client) ChatRoomRequestAddr ¶ added in v0.0.2
func (c *Client) ChatRoomRequestAddr(ctx context.Context, param *ChatRoomRequestAddrParam) (*ChatRoomRequestAddrResponse, error)
func (*Client) ChatRoomSendMsg ¶ added in v0.0.2
func (c *Client) ChatRoomSendMsg(ctx context.Context, param *ChatRoomSendMsgParam) (*ChatRoomSendMsgResponse, error)
func (*Client) ChatRoomSetMemberRole ¶ added in v0.0.2
func (c *Client) ChatRoomSetMemberRole(ctx context.Context, param *ChatRoomSetMemberRoleParam) (*ChatRoomSetMemberRoleResponse, error)
func (*Client) ChatRoomUpdateInOutNotification ¶ added in v0.0.4
func (c *Client) ChatRoomUpdateInOutNotification(ctx context.Context, param *ChatRoomUpdateInOutNotificationParam) (*ChatRoomUpdateInOutNotificationResponse, error)
func (*Client) ChatroomGet ¶ added in v0.0.2
func (c *Client) ChatroomGet(ctx context.Context, param *ChatroomGetParam) (*ChatroomGetResponse, error)
func (*Client) ChatroomGetBatch ¶ added in v0.0.2
func (c *Client) ChatroomGetBatch(ctx context.Context, param *ChatroomGetBatchParam) (*ChatroomGetBatchResponse, error)
func (*Client) FriendAdd ¶
func (c *Client) FriendAdd(ctx context.Context, param *FriendAddParam) (*FriendAddResponse, error)
func (*Client) FriendDelete ¶
func (c *Client) FriendDelete(ctx context.Context, param *FriendDeleteParam) (*FriendDeleteResponse, error)
func (*Client) FriendGet ¶
func (c *Client) FriendGet(ctx context.Context, param *FriendGetParam) (*FriendGetResponse, error)
func (*Client) FriendUpdate ¶
func (c *Client) FriendUpdate(ctx context.Context, param *FriendUpdateParam) (*FriendUpdateResponse, error)
func (*Client) GetUserInfos ¶
func (c *Client) GetUserInfos(ctx context.Context, param *GetUserInfosParam) (*GetUserInfosResponse, error)
func (*Client) MsgDelMsg ¶ added in v0.0.3
func (c *Client) MsgDelMsg(ctx context.Context, param *MsgDelMsgParam) (*MsgDelMsgResponse, error)
func (*Client) UserBlock ¶
func (c *Client) UserBlock(ctx context.Context, param *UserBlockParam) (*UserBlockResponse, error)
func (*Client) UserCreate ¶
func (c *Client) UserCreate(ctx context.Context, param *UserCreateParam) (*UserCreateResponse, error)
func (*Client) UserListBlackAndMuteList ¶
func (c *Client) UserListBlackAndMuteList(ctx context.Context, param *UserListBlackAndMuteListParam) (*UserListBlackAndMuteListResponse, error)
func (*Client) UserMute ¶
func (c *Client) UserMute(ctx context.Context, param *UserMuteParam) (*UserMuteResponse, error)
func (*Client) UserRefreshToken ¶
func (c *Client) UserRefreshToken(ctx context.Context, param *UserRefreshTokenParam) (*UserRefreshTokenResponse, error)
func (*Client) UserSetDonnop ¶
func (c *Client) UserSetDonnop(ctx context.Context, param *UserSetDonnopParam) (*UserSetDonnopResponse, error)
func (*Client) UserSetSpecialRelation ¶
func (c *Client) UserSetSpecialRelation(ctx context.Context, param *UserSetSpecialRelationParam) (*UserSetSpecialRelationResponse, error)
func (*Client) UserUnBlock ¶
func (c *Client) UserUnBlock(ctx context.Context, param *UserUnBlockParam) (*UserUnBlockResponse, error)
func (*Client) UserUpdate ¶
func (c *Client) UserUpdate(ctx context.Context, param *UserUpdateParam) (*UserUpdateResponse, error)
func (*Client) UserUpdateUserInfo ¶
func (c *Client) UserUpdateUserInfo(ctx context.Context, param *UserUpdateUserInfoParam) (*UserUpdateUserInfoResponse, error)
type ClientType ¶ added in v0.0.2
type ClientType int
type CreateUserInfo ¶
type DelayClosePolicy ¶
type DelayClosePolicy int
const ( DelayClosePolicyNever DelayClosePolicy = 0 // 不开启定时关闭 DelayClosePolicyByTime DelayClosePolicy = 1 // 固定时间关闭 DelayClosePolicyOnEmptyByTime DelayClosePolicy = 2 // 空闲关闭(等聊天室中没有用户后固定时间关闭) )
type DeleteMsgType ¶ added in v0.0.3
type DeleteMsgType int
const ( DeleteMsgTypeSingle DeleteMsgType = 7 DeleteMsgTypeTeam DeleteMsgType = 8 )
type FriendAddParam ¶
type FriendAddParam struct {
AccID string `schema:"accid,required"`
FAccID string `schema:"faccid,required"`
Type FriendAddType `schema:"type,required"`
Msg string `schema:"msg"`
ServerEx string `schema:"serverex"`
}
func (FriendAddParam) GetPath ¶
func (FriendAddParam) GetPath() string
type FriendAddResponse ¶
type FriendAddResponse struct {
BasicResponse
}
type FriendAddType ¶
type FriendAddType int
const ( FriendAddDirect FriendAddType = 1 FriendAddRequest FriendAddType = 2 FriendAddApprove FriendAddType = 3 FriendAddReject FriendAddType = 4 )
1直接加好友,2请求加好友,3同意加好友,4拒绝加好友
type FriendDeleteParam ¶
type FriendDeleteParam struct {
AccID string `schema:"accid,required"`
FAccID string `schema:"faccid,required"`
IsDeleteAlias bool `schema:"isDeleteAlias"`
}
func (FriendDeleteParam) GetPath ¶
func (FriendDeleteParam) GetPath() string
type FriendDeleteResponse ¶
type FriendDeleteResponse struct {
BasicResponse
}
type FriendGetParam ¶
type FriendGetParam struct {
AccID string `schema:"accid,required"`
UpdateTime int64 `schema:"updatetime,required"` // 毫秒
}
func (FriendGetParam) GetPath ¶
func (FriendGetParam) GetPath() string
type FriendGetResponse ¶
type FriendGetResponse struct {
BasicResponse
Friends []*FriendInfo `json:"friends"`
}
type FriendInfo ¶
type FriendUpdateParam ¶
type FriendUpdateParam struct {
AccID string `schema:"accid,required"`
FAccID string `schema:"faccid,required"`
Alias string `schema:"alias"`
Ex string `schema:"ex"`
ServerEx string `schema:"serverex"`
}
func (FriendUpdateParam) GetPath ¶
func (FriendUpdateParam) GetPath() string
type FriendUpdateResponse ¶
type FriendUpdateResponse struct {
BasicResponse
}
type GetUserInfosParam ¶
type GetUserInfosParam struct {
Accids StringSlice `schema:"accids,required"`
}
func (GetUserInfosParam) GetPath ¶
func (GetUserInfosParam) GetPath() string
type GetUserInfosResponse ¶
type GetUserInfosResponse struct {
BasicResponse
Uinfos []*UserInfo `json:"uinfos"`
}
type Logger ¶ added in v0.0.3
type Logger interface {
Info(args ...interface{})
Error(args ...interface{})
}
type MillsSecond ¶ added in v0.0.2
type MillsSecond int64
func NewMillsSecond ¶ added in v0.0.2
func NewMillsSecond(t time.Time) MillsSecond
func (MillsSecond) ToTime ¶ added in v0.0.2
func (t MillsSecond) ToTime() time.Time
type MsgDelMsgParam ¶ added in v0.0.3
type MsgDelMsgParam struct {
DeleteMsgID string `schema:"deleteMsgid,required"`
TimeTag int64 `schema:"timetag,required"`
Type DeleteMsgType `schema:"type,required"`
From string `schema:"from,required"`
To string `schema:"to,required"`
}
func (MsgDelMsgParam) GetPath ¶ added in v0.0.3
func (MsgDelMsgParam) GetPath() string
type MsgDelMsgResponse ¶ added in v0.0.3
type MsgDelMsgResponse struct {
BasicResponse
}
type Option ¶
type Option func(c *Client)
func WithEncoder ¶
func WithHTTPClient ¶
func WithLogger ¶ added in v0.0.3
type QueueLevel ¶
type QueueLevel int
const ( QueueLevelAny QueueLevel = 0 QueueLevelOnlyAdmin QueueLevel = 1 )
type RawBodyModel ¶
type RawBodyModel struct {
RawBody string `json:"-"`
}
func (*RawBodyModel) SetRawBody ¶
func (r *RawBodyModel) SetRawBody(raw []byte)
type RefreshTokenInfo ¶
type RelationType ¶
type RelationType int
const ( RelationTypeBlack RelationType = 1 RelationTypeMute RelationType = 2 )
1:黑名单操作,2:静音列表操作
type StringSlice ¶
type StringSlice []string
type UserBlockParam ¶
type UserBlockParam struct {
AccID string `schema:"accid,required"`
Needkick bool `schema:"needkick"`
KickNotifyExt string `schema:"kickNotifyExt"`
}
func (UserBlockParam) GetPath ¶
func (UserBlockParam) GetPath() string
type UserBlockResponse ¶
type UserBlockResponse struct {
BasicResponse
}
type UserCreateParam ¶
type UserCreateParam struct {
AccID string `schema:"accid,required"`
Name string `schema:"name"`
Icon string `schema:"icon"`
Token string `schema:"token"`
Sign string `schema:"sign"` // 用户签名
Email string `schema:"email"`
Birth string `schema:"birth"`
Mobile string `schema:"mobile"`
Gender int `schema:"gender"`
Ex string `schema:"ex"`
Bid string `schema:"bid"`
}
func (UserCreateParam) GetPath ¶
func (UserCreateParam) GetPath() string
type UserCreateResponse ¶
type UserCreateResponse struct {
BasicResponse
Info *CreateUserInfo `json:"info"`
}
type UserInfo ¶
type UserInfo struct {
AccID string `json:"accid"`
Name string `json:"name"`
Icon string `json:"icon"`
Sign string `json:"sign"` // 用户签名
Email string `json:"email"`
Birth string `json:"birth"`
Mobile string `json:"mobile"`
Ex string `json:"ex"`
Gender int `json:"gender"`
Valid bool `json:"valid"`
Mute bool `json:"mute"`
}
type UserListBlackAndMuteListParam ¶
type UserListBlackAndMuteListParam struct {
AccID string `schema:"accid,required"`
}
func (UserListBlackAndMuteListParam) GetPath ¶
func (UserListBlackAndMuteListParam) GetPath() string
type UserListBlackAndMuteListResponse ¶
type UserListBlackAndMuteListResponse struct {
BasicResponse
BlackList []string `json:"blacklist"`
MuteList []string `json:"mutelist"`
}
type UserMuteParam ¶
type UserMuteParam struct {
AccID string `schema:"accid,required"`
Mute bool `schema:"mute,required"`
}
func (UserMuteParam) GetPath ¶
func (UserMuteParam) GetPath() string
type UserMuteResponse ¶
type UserMuteResponse struct {
BasicResponse
}
type UserRefreshTokenParam ¶
type UserRefreshTokenParam struct {
AccID string `schema:"accid,required"`
}
func (UserRefreshTokenParam) GetPath ¶
func (UserRefreshTokenParam) GetPath() string
type UserRefreshTokenResponse ¶
type UserRefreshTokenResponse struct {
BasicResponse
Info *RefreshTokenInfo `json:"info"`
}
type UserSetDonnopParam ¶
type UserSetDonnopParam struct {
AccID string `schema:"accid,required"`
DonnopOpen bool `schema:"donnopOpen,required"`
}
func (UserSetDonnopParam) GetPath ¶
func (UserSetDonnopParam) GetPath() string
type UserSetDonnopResponse ¶
type UserSetDonnopResponse struct {
BasicResponse
}
type UserSetSpecialRelationParam ¶
type UserSetSpecialRelationParam struct {
AccID string `schema:"accid,required"`
TargetAcc string `schema:"targetAcc,required"`
RelationType RelationType `schema:"relationType,required"`
Value int `schema:"value,required"` // 0:取消,1:加入
}
func (UserSetSpecialRelationParam) GetPath ¶
func (UserSetSpecialRelationParam) GetPath() string
type UserSetSpecialRelationResponse ¶
type UserSetSpecialRelationResponse struct {
BasicResponse
}
type UserUnBlockParam ¶
type UserUnBlockParam struct {
AccID string `schema:"accid,required"`
}
func (UserUnBlockParam) GetPath ¶
func (UserUnBlockParam) GetPath() string
type UserUnBlockResponse ¶
type UserUnBlockResponse struct {
BasicResponse
}
type UserUpdateParam ¶
type UserUpdateParam struct {
AccID string `schema:"accid,required"`
Token string `schema:"token"`
}
func (UserUpdateParam) GetPath ¶
func (UserUpdateParam) GetPath() string
type UserUpdateResponse ¶
type UserUpdateResponse struct {
BasicResponse
}
type UserUpdateUserInfoParam ¶
type UserUpdateUserInfoParam struct {
AccID string `schema:"accid,required"`
Name string `schema:"name"`
Icon string `schema:"icon"`
Sign string `schema:"sign"` // 用户签名
Email string `schema:"email"`
Birth string `schema:"birth"`
Mobile string `schema:"mobile"`
Gender int `schema:"gender"`
Ex string `schema:"ex"`
Bid string `schema:"bid"` // 反垃圾业务ID,JSON字符串,{"textbid":"","picbid":""}
}
func (UserUpdateUserInfoParam) GetPath ¶
func (UserUpdateUserInfoParam) GetPath() string
type UserUpdateUserInfoResponse ¶
type UserUpdateUserInfoResponse struct {
BasicResponse
}
type WithRawBody ¶
type WithRawBody interface {
SetRawBody(raw []byte)
}
type YunxinError ¶ added in v0.0.2
type YunxinError struct {
BasicResponse
}
func (*YunxinError) Error ¶ added in v0.0.4
func (y *YunxinError) Error() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.