Documentation ¶
Index ¶
- Constants
- Variables
- func NewRetryableHTTPClient(opts ...RetryableHTTPClientOption) *http.Client
- func WithEncryptor(encryptor *Encryptor) func(c *Client)
- func WithHTTPClient(client *http.Client) func(c *Client)
- type BatchDeleteUserRequest
- type Client
- func (c *Client) AddGroupMember(ctx context.Context, request GroupUpdateMemberRequest) (response Response, err error)
- func (c *Client) BatchDeleteUser(ctx context.Context, request BatchDeleteUserRequest) (response Response, err error)
- func (c *Client) CreateDept(ctx context.Context, request CreateDeptRequest) (response CreateDeptResponse, err error)
- func (c *Client) CreateGroup(ctx context.Context, request CreateGroupRequest) (response CreateGroupResponse, err error)
- func (c *Client) CreateSession(ctx context.Context, request CreateSessionRequest) (response SessionResponse, err error)
- func (c *Client) CreateUser(ctx context.Context, request CreateUserRequest) (response Response, err error)
- func (c *Client) DelGroupMember(ctx context.Context, request GroupUpdateMemberRequest) (response Response, err error)
- func (c *Client) DeleteDept(ctx context.Context, deptID int) (response Response, err error)
- func (c *Client) DeleteGroup(ctx context.Context, groupID string) (response Response, err error)
- func (c *Client) DeleteUser(ctx context.Context, userID string) (response Response, err error)
- func (c *Client) GetDeptAliasList(ctx context.Context) (response DeptAliasListResponse, err error)
- func (c *Client) GetDeptIDByAlias(ctx context.Context, alias string) (response DeptIDByAliasResponse, err error)
- func (c *Client) GetDeptList(ctx context.Context, id ...int) (response DeptListResponse, err error)
- func (c *Client) GetDeptUserList(ctx context.Context, deptID int) (response DeptUserListResponse, err error)
- func (c *Client) GetDeptUserSimpleList(ctx context.Context, deptID int) (response DeptUserListResponse, err error)
- func (c *Client) GetGroupInfo(ctx context.Context, groupID string) (response GroupInfoResponse, err error)
- func (c *Client) GetGroupList(ctx context.Context, userID ...string) (response GroupListResponse, err error)
- func (c *Client) GetSession(ctx context.Context, sessionID string) (response SessionResponse, err error)
- func (c *Client) GetToken(ctx context.Context) (string, error)
- func (c *Client) GetUser(ctx context.Context, userID string) (response UserResponse, err error)
- func (c *Client) GetUserEnableState(ctx context.Context, userID string) (response UserEnableStateResponse, err error)
- func (c *Client) Identify(ctx context.Context, token string) (response IdentifyResponse, err error)
- func (c *Client) IsGroupMember(ctx context.Context, groupID string, userID string) (response IsGroupMemberResponse, err error)
- func (c *Client) SendExLinkMessage(ctx context.Context, request ExLinkMessageRequest) (response Response, err error)
- func (c *Client) SendFileMessage(ctx context.Context, request FileMessageRequest) (response Response, err error)
- func (c *Client) SendFileSessionMessage(ctx context.Context, request FileSessionMessageRequest) (response Response, err error)
- func (c *Client) SendImageMessage(ctx context.Context, request ImageMessageRequest) (response Response, err error)
- func (c *Client) SendImageSessionMessage(ctx context.Context, request ImageSessionMessageRequest) (response Response, err error)
- func (c *Client) SendLinkMessage(ctx context.Context, request LinkMessageRequest) (response Response, err error)
- func (c *Client) SendMessage(ctx context.Context, request InterfaceMessageRequest) (response Response, err error)
- func (c *Client) SendMpNewsMessage(ctx context.Context, request MpNewsMessageRequest) (response Response, err error)
- func (c *Client) SendPopWindowMessage(ctx context.Context, request PopWindowMessageRequest) (response Response, err error)
- func (c *Client) SendSessionMessage(ctx context.Context, request InterfaceSessionMessageRequest) (response Response, err error)
- func (c *Client) SendSysMessage(ctx context.Context, request MessageSysMessageRequest) (response Response, err error)
- func (c *Client) SendTextMessage(ctx context.Context, request TextMessageRequest) (response Response, err error)
- func (c *Client) SendTextSessionMessage(ctx context.Context, request TextSessionMessageRequest) (response Response, err error)
- func (c *Client) SendVideoSessionMessage(ctx context.Context, request VideoSessionMessageRequest) (response Response, err error)
- func (c *Client) SendVoiceSessionMessage(ctx context.Context, request VoiceSessionMessageRequest) (response Response, err error)
- func (c *Client) UpdateDept(ctx context.Context, request UpdateDeptRequest) (response Response, err error)
- func (c *Client) UpdateGroup(ctx context.Context, request UpdateGroupRequest) (response Response, err error)
- func (c *Client) UpdateSession(ctx context.Context, request UpdateSessionRequest) (response SessionResponse, err error)
- func (c *Client) UpdateUser(ctx context.Context, request UpdateUserRequest) (response Response, err error)
- func (c *Client) UpdateUserEnableState(ctx context.Context, request UpdateUserEnableStateRequest) (response Response, err error)
- func (c *Client) UpdateUserPosition(ctx context.Context, request UpdateUserPositionRequest) (response Response, err error)
- type ClientOption
- type Config
- type CreateDeptRequest
- type CreateDeptResponse
- type CreateGroupRequest
- type CreateGroupResponse
- type CreateSessionRequest
- type CreateUserRequest
- type DeptAliasItem
- type DeptAliasListResponse
- type DeptDetail
- type DeptIDByAliasResponse
- type DeptItem
- type DeptListResponse
- type DeptUserListResponse
- type EnableState
- type Encryptor
- type Error
- type ExLinkMessageRequest
- type FileMessageRequest
- type FileSessionMessageRequest
- type GroupInfoMember
- type GroupInfoResponse
- type GroupItem
- type GroupListResponse
- type GroupUpdateMemberRequest
- type IdentifyResponse
- type IdentifyStatus
- type IdentifyUserInfo
- type ImageMessageRequest
- type ImageSessionMessageRequest
- type InterfaceMessageRequest
- type InterfaceSessionMessageRequest
- type IsGroupMemberResponse
- type LinkMessageRequest
- type MessageExLink
- type MessageFile
- type MessageLink
- type MessageMedia
- type MessageMpNews
- type MessagePopWindow
- type MessageRequest
- type MessageSysMessageRequest
- type MessageSysMessageSysMsg
- type MessageSysMessageSysMsgMsg
- type MessageSysMessageToAll
- type MessageText
- type MpNewsMessageRequest
- type MsgType
- type NormalRequest
- type PopWindowMessageRequest
- type RawData
- type Receive
- type ReceiveMessage
- type ReceiveRequest
- type Response
- type RetryableHTTPClientOption
- func WithRetryableHTTPClientBackoff(backoff retryablehttp.Backoff) RetryableHTTPClientOption
- func WithRetryableHTTPClientCheckRetry(checkRetry retryablehttp.CheckRetry) RetryableHTTPClientOption
- func WithRetryableHTTPClientLogger(logger retryablehttp.Logger) RetryableHTTPClientOption
- func WithRetryableHTTPClientRetryMax(max int) RetryableHTTPClientOption
- func WithRetryableHTTPClientRetryWaitMax(max time.Duration) RetryableHTTPClientOption
- func WithRetryableHTTPClientRetryWaitMin(min time.Duration) RetryableHTTPClientOption
- type SessionMessageResponse
- type SessionResponse
- type SessionType
- type SpecialRequest
- type TextMessageRequest
- type TextSessionMessageRequest
- type UpdateDeptRequest
- type UpdateGroupRequest
- type UpdateSessionRequest
- type UpdateUserEnableStateRequest
- type UpdateUserPositionRequest
- type UpdateUserRequest
- type UserEnableStateResponse
- type UserItem
- type UserResponse
- type VideoSessionMessageRequest
- type VoiceSessionMessageRequest
Constants ¶
View Source
const ( NormalRequestType requestType = "normal" SpecialRequestType requestType = "special" )
Variables ¶
View Source
var ( ErrReceiveEmptyEncrypt = newError(-1, "encrypt is empty") ErrReceiveEmptyData = newError(-1, "data is empty") )
View Source
var ErrUnexpectedResponseCode = errors.New("youdu sdk: unexpected response code")
Functions ¶
func NewRetryableHTTPClient ¶ added in v2.4.0
func NewRetryableHTTPClient(opts ...RetryableHTTPClientOption) *http.Client
func WithEncryptor ¶ added in v2.1.0
func WithHTTPClient ¶ added in v2.3.0
Types ¶
type BatchDeleteUserRequest ¶ added in v2.2.0
type BatchDeleteUserRequest struct {
DelList []string `json:"delList"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(config *Config, opts ...ClientOption) *Client
func (*Client) AddGroupMember ¶ added in v2.0.2
func (*Client) BatchDeleteUser ¶ added in v2.2.0
func (*Client) CreateDept ¶ added in v2.1.1
func (c *Client) CreateDept(ctx context.Context, request CreateDeptRequest) (response CreateDeptResponse, err error)
func (*Client) CreateGroup ¶ added in v2.0.2
func (c *Client) CreateGroup( ctx context.Context, request CreateGroupRequest, ) (response CreateGroupResponse, err error)
func (*Client) CreateSession ¶
func (c *Client) CreateSession( ctx context.Context, request CreateSessionRequest, ) (response SessionResponse, err error)
func (*Client) CreateUser ¶ added in v2.2.0
func (*Client) DelGroupMember ¶ added in v2.0.2
func (*Client) DeleteDept ¶ added in v2.1.1
func (*Client) DeleteGroup ¶ added in v2.0.2
func (*Client) DeleteUser ¶ added in v2.2.0
func (*Client) GetDeptAliasList ¶ added in v2.1.0
func (c *Client) GetDeptAliasList(ctx context.Context) (response DeptAliasListResponse, err error)
func (*Client) GetDeptIDByAlias ¶ added in v2.3.0
func (*Client) GetDeptList ¶
func (*Client) GetDeptUserList ¶
func (*Client) GetDeptUserSimpleList ¶ added in v2.0.3
func (*Client) GetGroupInfo ¶ added in v2.0.2
func (*Client) GetGroupList ¶ added in v2.0.2
func (*Client) GetSession ¶
func (*Client) GetUserEnableState ¶ added in v2.1.1
func (*Client) IsGroupMember ¶ added in v2.0.2
func (*Client) SendExLinkMessage ¶
func (*Client) SendFileMessage ¶
func (*Client) SendFileSessionMessage ¶
func (*Client) SendImageMessage ¶
func (*Client) SendImageSessionMessage ¶
func (*Client) SendLinkMessage ¶
func (*Client) SendMessage ¶
func (*Client) SendMpNewsMessage ¶
func (*Client) SendPopWindowMessage ¶ added in v2.2.0
func (*Client) SendSessionMessage ¶
func (*Client) SendSysMessage ¶ added in v2.0.2
func (*Client) SendTextMessage ¶
func (*Client) SendTextSessionMessage ¶
func (*Client) SendVideoSessionMessage ¶
func (*Client) SendVoiceSessionMessage ¶
func (*Client) UpdateDept ¶ added in v2.1.1
func (*Client) UpdateGroup ¶ added in v2.0.2
func (*Client) UpdateSession ¶
func (c *Client) UpdateSession( ctx context.Context, request UpdateSessionRequest, ) (response SessionResponse, err error)
func (*Client) UpdateUser ¶ added in v2.2.0
func (*Client) UpdateUserEnableState ¶ added in v2.1.1
func (*Client) UpdateUserPosition ¶ added in v2.2.0
type ClientOption ¶ added in v2.1.0
type ClientOption func(c *Client)
type CreateDeptRequest ¶ added in v2.1.1
type CreateDeptResponse ¶ added in v2.1.1
type CreateDeptResponse struct {
ID int `json:"id"`
}
type CreateGroupRequest ¶ added in v2.0.2
type CreateGroupRequest struct {
Name string `json:"name"`
}
type CreateGroupResponse ¶ added in v2.0.2
type CreateGroupResponse struct {
ID string `json:"id"`
}
type CreateSessionRequest ¶
type CreateSessionRequest struct { Title string `json:"title"` Creator string `json:"creator"` Type SessionType `json:"type,omitempty"` Member []string `json:"member"` }
type CreateUserRequest ¶ added in v2.2.0
type CreateUserRequest struct { UserID string `json:"userId"` Name string `json:"name"` Gender int `json:"gender"` Mobile string `json:"mobile"` Phone string `json:"phone"` Email string `json:"email"` Dept []int `json:"dept"` EnableState EnableState `json:"enableState"` ShortCode string `json:"shortCode"` }
type DeptAliasItem ¶ added in v2.1.0
type DeptAliasListResponse ¶ added in v2.1.0
type DeptAliasListResponse struct {
AliasList []DeptAliasItem `json:"aliasList"`
}
type DeptDetail ¶
type DeptIDByAliasResponse ¶ added in v2.3.0
type DeptIDByAliasResponse struct {
ID int `json:"id"`
}
type DeptListResponse ¶
type DeptListResponse struct {
DeptList []DeptItem `json:"deptList"`
}
type DeptUserListResponse ¶
type DeptUserListResponse struct {
UserList []UserItem `json:"userList"`
}
type EnableState ¶ added in v2.1.1
type EnableState int
const ( EnableForbidState EnableState = -1 EnableAuthorizedState EnableState = 1 EnableUnactivatedState EnableState = 0 )
type Encryptor ¶
type Encryptor struct {
// contains filtered or unexported fields
}
func NewEncryptor ¶
func NewEncryptorWithConfig ¶
type ExLinkMessageRequest ¶
type ExLinkMessageRequest struct { ToUser string `json:"toUser"` ToDept string `json:"toDept"` MsgType MsgType `json:"msgType"` ExLink []MessageExLink `json:"exlink"` }
type FileMessageRequest ¶
type FileMessageRequest struct { ToUser string `json:"toUser"` ToDept string `json:"toDept"` MsgType MsgType `json:"msgType"` File MessageMedia `json:"file"` }
type FileSessionMessageRequest ¶
type FileSessionMessageRequest struct { SessionID string `json:"sessionId,omitempty"` Receiver string `json:"receiver,omitempty"` Sender string `json:"sender"` MsgType MsgType `json:"msgType"` File MessageFile `json:"file"` }
type GroupInfoMember ¶ added in v2.0.2
type GroupInfoResponse ¶ added in v2.0.2
type GroupInfoResponse struct { ID string `json:"id"` Name string `json:"name"` Members []GroupInfoMember `json:"members"` }
type GroupListResponse ¶ added in v2.0.2
type GroupListResponse struct {
GroupList []GroupItem `json:"groupList"`
}
type GroupUpdateMemberRequest ¶ added in v2.0.2
type IdentifyResponse ¶
type IdentifyResponse struct { Status IdentifyStatus `json:"status"` UserInfo IdentifyUserInfo `json:"userInfo"` }
type IdentifyStatus ¶
type IdentifyUserInfo ¶
type ImageMessageRequest ¶
type ImageMessageRequest struct { ToUser string `json:"toUser"` ToDept string `json:"toDept"` MsgType MsgType `json:"msgType"` Image MessageMedia `json:"image"` }
type ImageSessionMessageRequest ¶
type ImageSessionMessageRequest struct { SessionID string `json:"sessionId,omitempty"` Receiver string `json:"receiver,omitempty"` Sender string `json:"sender"` MsgType MsgType `json:"msgType"` Image MessageMedia `json:"image"` }
type InterfaceMessageRequest ¶
type InterfaceMessageRequest interface{}
type InterfaceSessionMessageRequest ¶
type InterfaceSessionMessageRequest interface{}
type IsGroupMemberResponse ¶ added in v2.0.2
type IsGroupMemberResponse struct {
Belong bool `json:"belong"`
}
type LinkMessageRequest ¶
type LinkMessageRequest struct { ToUser string `json:"toUser"` ToDept string `json:"toDept"` MsgType MsgType `json:"msgType"` Link MessageLink `json:"link"` }
type MessageExLink ¶
type MessageFile ¶
type MessageLink ¶
type MessageMedia ¶
type MessageMedia struct {
MediaID string `json:"media_id"`
}
type MessageMpNews ¶
type MessagePopWindow ¶ added in v2.2.0
type MessageRequest ¶
type MessageRequest struct { // General ToUser string `json:"toUser"` ToDept string `json:"toDept"` MsgType MsgType `json:"msgType"` // Text, Image, File, MpNews, Link, ExLink Text MessageText `json:"text,omitempty"` Image MessageMedia `json:"image,omitempty"` File MessageMedia `json:"file,omitempty"` MpNews []MessageMpNews `json:"mpnews,omitempty"` Link MessageLink `json:"link,omitempty"` ExLink []MessageExLink `json:"exlink,omitempty"` // SysMsg ToAll MessageSysMessageToAll `json:"toAll,omitempty"` SysMsg MessageSysMessageSysMsg `json:"sysMsg"` }
type MessageSysMessageRequest ¶ added in v2.0.2
type MessageSysMessageRequest struct { ToUser string `json:"toUser,omitempty"` ToDept string `json:"toDept,omitempty"` ToAll MessageSysMessageToAll `json:"toAll,omitempty"` MsgType MsgType `json:"msgType"` SysMsg MessageSysMessageSysMsg `json:"sysMsg"` }
type MessageSysMessageSysMsg ¶ added in v2.0.2
type MessageSysMessageSysMsg struct { Title string `json:"title"` PopDuration int `json:"popDuration,omitempty"` Msg []MessageSysMessageSysMsgMsg `json:"msg"` }
type MessageSysMessageSysMsgMsg ¶ added in v2.0.2
type MessageSysMessageSysMsgMsg struct { Text MessageText `json:"text,omitempty"` Link MessageLink `json:"link,omitempty"` }
type MessageSysMessageToAll ¶ added in v2.0.2
type MessageSysMessageToAll struct {
OnliyOnline bool `json:"onliyOnline"`
}
type MessageText ¶
type MessageText struct {
Content string `json:"content"`
}
type MpNewsMessageRequest ¶
type MpNewsMessageRequest struct { ToUser string `json:"toUser"` ToDept string `json:"toDept"` MsgType MsgType `json:"msgType"` MpNews []MessageMpNews `json:"mpnews"` }
type NormalRequest ¶ added in v2.2.0
type PopWindowMessageRequest ¶ added in v2.2.0
type PopWindowMessageRequest struct { ToUser string `json:"toUser"` ToDept string `json:"toDept"` PopWindow MessagePopWindow `json:"popWindow"` }
type Receive ¶ added in v2.0.2
type Receive struct {
// contains filtered or unexported fields
}
func NewReceive ¶ added in v2.0.2
func (*Receive) Decrypt ¶ added in v2.0.2
func (s *Receive) Decrypt(request ReceiveRequest) (message ReceiveMessage, err error)
type ReceiveMessage ¶ added in v2.0.2
type ReceiveMessage struct { FromUser string `json:"fromUser"` CreateTime int `json:"createTime"` PackageID string `json:"packageId"` MsgType MsgType `json:"msgType"` Text MessageText `json:"text,omitempty"` Image MessageMedia `json:"image,omitempty"` File MessageFile `json:"file,omitempty"` }
type ReceiveRequest ¶ added in v2.0.2
type RetryableHTTPClientOption ¶ added in v2.4.0
type RetryableHTTPClientOption func(client *retryablehttp.Client)
func WithRetryableHTTPClientBackoff ¶ added in v2.4.0
func WithRetryableHTTPClientBackoff(backoff retryablehttp.Backoff) RetryableHTTPClientOption
func WithRetryableHTTPClientCheckRetry ¶ added in v2.4.0
func WithRetryableHTTPClientCheckRetry(checkRetry retryablehttp.CheckRetry) RetryableHTTPClientOption
func WithRetryableHTTPClientLogger ¶ added in v2.4.0
func WithRetryableHTTPClientLogger(logger retryablehttp.Logger) RetryableHTTPClientOption
func WithRetryableHTTPClientRetryMax ¶ added in v2.4.0
func WithRetryableHTTPClientRetryMax(max int) RetryableHTTPClientOption
func WithRetryableHTTPClientRetryWaitMax ¶ added in v2.4.0
func WithRetryableHTTPClientRetryWaitMax(max time.Duration) RetryableHTTPClientOption
func WithRetryableHTTPClientRetryWaitMin ¶ added in v2.4.0
func WithRetryableHTTPClientRetryWaitMin(min time.Duration) RetryableHTTPClientOption
type SessionMessageResponse ¶
type SessionMessageResponse struct { SessionID string `json:"sessionId,omitempty"` Receiver string `json:"receiver,omitempty"` Sender string `json:"sender"` MsgType MsgType `json:"msgType"` Text MessageText `json:"text,omitempty"` Image MessageMedia `json:"image,omitempty"` File MessageFile `json:"file,omitempty"` Voice MessageMedia `json:"voice,omitempty"` Video MessageMedia `json:"video,omitempty"` }
type SessionResponse ¶
type SpecialRequest ¶ added in v2.2.0
type TextMessageRequest ¶
type TextMessageRequest struct { ToUser string `json:"toUser"` ToDept string `json:"toDept"` MsgType MsgType `json:"msgType"` Text MessageText `json:"text"` }
type TextSessionMessageRequest ¶
type TextSessionMessageRequest struct { SessionID string `json:"sessionId,omitempty"` Receiver string `json:"receiver,omitempty"` Sender string `json:"sender"` MsgType MsgType `json:"msgType"` Text MessageText `json:"text"` }
type UpdateDeptRequest ¶ added in v2.1.1
type UpdateGroupRequest ¶ added in v2.0.2
type UpdateSessionRequest ¶
type UpdateUserEnableStateRequest ¶ added in v2.1.1
type UpdateUserEnableStateRequest struct { UserIDList []string `json:"userIdList"` EnableState EnableState `json:"enableState"` }
type UpdateUserPositionRequest ¶ added in v2.2.0
type UpdateUserRequest ¶ added in v2.2.0
type UserEnableStateResponse ¶ added in v2.1.1
type UserEnableStateResponse struct {
EnableState int `json:"enableState"`
}
type UserItem ¶ added in v2.1.0
type UserItem struct { UserID string `json:"userId"` Name string `json:"name"` Gender int `json:"gender"` Mobile string `json:"mobile,omitempty"` Phone string `json:"phone,omitempty"` Email string `json:"email,omitempty"` Dept []int `json:"dept"` DeptDetail []DeptDetail `json:"deptDetail,omitempty"` }
type UserResponse ¶
type VideoSessionMessageRequest ¶
type VideoSessionMessageRequest struct { SessionID string `json:"sessionId,omitempty"` Receiver string `json:"receiver,omitempty"` Sender string `json:"sender"` MsgType MsgType `json:"msgType"` Video MessageMedia `json:"video"` }
type VoiceSessionMessageRequest ¶
type VoiceSessionMessageRequest struct { SessionID string `json:"sessionId,omitempty"` Receiver string `json:"receiver,omitempty"` Sender string `json:"sender"` MsgType MsgType `json:"msgType"` Voice MessageMedia `json:"voice"` }
Click to show internal directories.
Click to hide internal directories.