Versions in this module Expand all Collapse all v1 v1.1.1 Apr 7, 2023 v1.1.0 Jul 27, 2022 v1.0.0 Jun 24, 2022 v0 v0.3.0 Jun 24, 2022 Changes in this version type Auth + func (a *Auth) SetAuth(userId, password string) (bool, error) type Config + Path string + func (c *Config) GetDefaultPath() string + func (c *Config) GetPath() string type Dept + func (d *Dept) GetId(alias string) type Group + func (g *Group) DelMember(groupId string, userId ...string) (bool, error) + type SetAuthResp struct + CreateTime int + FromUser string + MsgType string + PackageId int + Passwd string + type SimpleUserInfo struct + Dept []int + Gender int + Gid int + Name string + UserId string type User + func (u *User) EnableState(userId string) (int, error) + func (u *User) List(deptId int) ([]UserInfo, error) + func (u *User) SimpleList(deptId int) ([]SimpleUserInfo, error) v0.2.0 Jun 22, 2022 Changes in this version + type Auth struct + func NewAuth(config *Config) *Auth + func (a *Auth) Identify(token string) (i IdentifyResp, err error) + type Group struct + func NewGroup(config *Config) *Group + func (g *Group) AddMember(id int, userId int) + func (g *Group) Create(name string) (string, error) + func (g *Group) Delete(id int) + func (g *Group) Info(groupId string) (*GroupInfo, error) + func (g *Group) IsMember(groupId, userId string) (bool, error) + func (g *Group) List(userId ...string) ([]GroupItem, error) + func (g *Group) RemoveMember(id int, userId int) + func (g *Group) Update(id int, name string) + type GroupInfo struct + Admins interface{} + BelongDeptId int + Id string + IsDeptGroup bool + Master int + Members []struct{ ... } + Name string + type GroupItem struct + BelongDeptId int + Id string + IsDeptGroup bool + Name string + Version int + type IdentifyResp struct + Buin int + Status struct{ ... } + UserInfo struct{ ... } type Media + func (m *Media) Get(mediaId string) (r MediaGetResp, err error) + func (m *Media) Search(mediaId string) (i MediaInfo, err error) + type MediaGetResp struct + Body string + Name string + Size int + type MediaInfo struct + Name string + Size int type Message + func NewMessage(config *Config) *Message + func (m *Message) Popwindow(msg message.Message) error + func (m *Message) Send(msg message.Message) error + func (m *Message) SendFile(toUser, mediaId string, toDept ...string) error + func (m *Message) SendImage(toUser, mediaId string, toDept ...string) error + func (m *Message) SendText(toUser, content string, toDept ...string) error + type Session struct + func NewSession(config *Config) *Session + func (s *Session) Create(title string, members []string) (*session.Session, error) + func (s *Session) Get(sessionId string) (*session.Session, error) + func (s *Session) Send(message session.Message) error + func (s *Session) Update(sessionId, opUser, title string, addMembers, delMembers []string) (*session.Session, error) + type User struct + func NewUser(config *Config) *User + func (u *User) Get(userId string) (*UserInfo, error) + type UserInfo struct + Attrs []interface{} + Dept []int + DeptDetail []struct{ ... } + Email string + Gender int + Gid int + Mobile string + Name string + Phone string + UserId string type Youdu + func (y *Youdu) AccessToken() (string, error) + func (y *Youdu) Auth() *Auth + func (y *Youdu) Group() *Group + func (y *Youdu) Session() *Session + func (y *Youdu) User() *User v0.1.1 Jun 17, 2022 v0.1.0 Jun 16, 2022 Changes in this version + const MediaTypeFile + const MediaTypeImage + const MediaTypeVideo + const MediaTypeVoice + const MsgTypeAudio + const MsgTypeFile + const MsgTypeImage + const MsgTypeLink + const MsgTypeMpNews + const MsgTypeText + const MsgTypeVideo + func NewAccessTokenProvider(config *Config) *accessTokenProvider + func NewEncryptor(config *Config) *encryptor + type Config struct + AesKey string + Api string + AppId string + Buin int + func (c *Config) GetAccessTokenProvider() *accessTokenProvider + func (c *Config) GetEncryptor() *encryptor + func (c *Config) GetHttp() *Http + type DecryptResult struct + AppId string + Data string + Length int32 + func (d *DecryptResult) Unmarshal(v interface{}) error + type Dept struct + func NewDept(config *Config) *Dept + func (d *Dept) GetList(depId int) ([]DeptItem, error) + type DeptItem struct + Id int + Name string + ParentId int + SortId int + type ExLinkItem struct + Digest string + MediaId string + Title string + Url string + type ExLinkMessage struct + ExLink *[]ExLinkItem + MsgType string + ToDept string + ToUser string + type FileMessage struct + File *MediaItem + MsgType string + ToDept string + ToUser string + type Http struct + func NewHttp(config *Config) *Http + func (h *Http) Get(url string, params map[string]string, fn ...func(*resty.Request)) (*Response, error) + func (h *Http) Post(url string, params interface{}, fn ...func(*resty.Request)) (*Response, error) + func (h *Http) Request(method, url string, params interface{}, fn ...func(*resty.Request)) (*Response, error) + type ImageMessage struct + Image *MediaItem + MsgType string + ToDept string + ToUser string + type LinkItem struct + Action int + Title string + Url string + type LinkMessage struct + Link *LinkItem + MsgType string + ToDept string + ToUser string + type MailMessage struct + Mail ... + MsgType string + ToEmail string + ToUser string + type Media struct + func NewMedia(config *Config) *Media + func (m *Media) Upload(fileType string, filePath string) (string, error) + type MediaItem struct + MediaId string + type Message interface + type MessageSender struct + func NewMessageSender(config *Config) *MessageSender + func (m *MessageSender) Send(message Message) error + func (m *MessageSender) SendText(toUser, content string, toDept ...string) error + type MpNewsItem struct + Content string + Digest string + MediaId string + ShowFront int + Title string + type MpNewsMessage struct + MpNews []*MpNewsItem + MsgType string + ToDept string + ToUser string + type Pkcs7 struct + func NewPkcs7() *Pkcs7 + func (p *Pkcs7) Padding(content []byte) []byte + func (p *Pkcs7) Unpadding(content []byte) []byte + type Response struct + func NewResponse(restyResponse *resty.Response) *Response + func (r *Response) Body() []byte + func (r *Response) Header() map[string][]string + func (r *Response) IsSuccess() bool + func (r *Response) Json() (map[string]interface{}, error) + func (r *Response) StatusCode() int + func (r *Response) String() string + type SmsMessage struct + MsgType string + Sms ... + ToDept string + ToUser string + type TextItem struct + Content string + type TextMessage struct + MsgType string + Text *TextItem + ToDept string + ToUser string + type Youdu struct + func New(config *Config) *Youdu + func (y *Youdu) Config() *Config + func (y *Youdu) Dept() *Dept + func (y *Youdu) Encryptor() *encryptor + func (y *Youdu) GetAccessToken() (string, error) + func (y *Youdu) Media() *Media + func (y *Youdu) Message() *MessageSender