Versions in this module Expand all Collapse all v1 v1.0.2 Apr 7, 2023 v1.0.1 Sep 5, 2022 v1.0.0 Sep 5, 2022 Changes in this version + const MediaTypeFile + const MediaTypeImage + const MediaTypeVideo + const MediaTypeVoice + func NewAccessTokenProvider(config *Config) *accessTokenProvider + func NewEncryptor(config *Config) *encryptor + type Auth struct + func NewAuth(config *Config) *Auth + func (a *Auth) Identify(token string) (i IdentifyResp, err error) + func (a *Auth) SetAuth(userId, password string) (bool, error) + type Config struct + AesKey string + Api string + AppId string + Buin int + Path string + func (c *Config) GetAccessTokenProvider() *accessTokenProvider + func (c *Config) GetDefaultPath() string + func (c *Config) GetEncryptor() *encryptor + func (c *Config) GetHttp() *Http + func (c *Config) GetPath() string + 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 Group struct + func NewGroup(config *Config) *Group + func (g *Group) AddMember(groupId string, userId ...string) (bool, error) + func (g *Group) Create(name string) (string, error) + func (g *Group) DelMember(groupId string, userId ...string) (bool, error) + func (g *Group) Delete(groupId string) (bool, error) + 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) Update(groupId, groupName string) (bool, error) + 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 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 IdentifyResp struct + Buin int + Status struct{ ... } + UserInfo struct{ ... } + type Media struct + func NewMedia(config *Config) *Media + func (m *Media) Get(mediaId string) (r MediaGetResp, err error) + func (m *Media) Search(mediaId string) (i MediaInfo, err error) + func (m *Media) Upload(fileType string, filePath string) (string, error) + type MediaGetResp struct + Body string + Name string + Size int + type MediaInfo struct + Name string + Size int + type Message struct + 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 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 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 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 struct + func NewUser(config *Config) *User + func (u *User) EnableState(userId string) (int, error) + func (u *User) Get(userId string) (UserInfo, error) + func (u *User) List(deptId int) ([]UserInfo, error) + func (u *User) SimpleList(deptId int) ([]SimpleUserInfo, 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 struct + func New(config *Config) *Youdu + func (y *Youdu) AccessToken() (string, error) + func (y *Youdu) Auth() *Auth + func (y *Youdu) Config() *Config + func (y *Youdu) Dept() *Dept + func (y *Youdu) Encryptor() *encryptor + func (y *Youdu) Group() *Group + func (y *Youdu) Media() *Media + func (y *Youdu) Message() *Message + func (y *Youdu) Session() *Session + func (y *Youdu) User() *User Other modules containing this package github.com/addcnos/youdu/v2