Documentation
¶
Index ¶
- Constants
- func NewAccessTokenProvider(config *Config) *accessTokenProvider
- func NewEncryptor(config *Config) *encryptor
- type Auth
- type Config
- type DecryptResult
- type Dept
- type DeptItem
- type 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
- type GroupItem
- type 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
- type Media
- type MediaGetResp
- type MediaInfo
- type 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
- type Response
- type 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
- type SimpleUserInfo
- type User
- type UserInfo
- type 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
Constants ¶
View Source
const ( MediaTypeImage = "image" MediaTypeFile = "file" MediaTypeVoice = "voice" MediaTypeVideo = "video" )
Variables ¶
This section is empty.
Functions ¶
func NewAccessTokenProvider ¶
func NewAccessTokenProvider(config *Config) *accessTokenProvider
func NewEncryptor ¶
func NewEncryptor(config *Config) *encryptor
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
type Config ¶
type Config struct {
Api string
Buin int
AppId string
AesKey string
Path string
// contains filtered or unexported fields
}
func (*Config) GetAccessTokenProvider ¶
func (c *Config) GetAccessTokenProvider() *accessTokenProvider
func (*Config) GetDefaultPath ¶
func (*Config) GetEncryptor ¶
func (c *Config) GetEncryptor() *encryptor
type DecryptResult ¶
func (*DecryptResult) Unmarshal ¶
func (d *DecryptResult) Unmarshal(v interface{}) error
type GroupInfo ¶
type GroupInfo struct {
Id string `json:"id"`
Name string `json:"name"`
Admins interface{} `json:"admins"`
BelongDeptId int `json:"belongDeptId"`
IsDeptGroup bool `json:"isDeptGroup"`
Master int `json:"master"`
Members []struct {
Account string `json:"account"`
Name string `json:"name"`
Mobile string `json:"mobile"`
} `json:"members"`
}
type Http ¶
type Http struct {
// contains filtered or unexported fields
}
type IdentifyResp ¶
type IdentifyResp struct {
Buin int `json:"buin"`
Status struct {
Code int `json:"code"`
Message string `json:"message"`
CreatedAt string `json:"createdAt"`
} `json:"status"`
UserInfo struct {
Gid int `json:"gid"`
Account string `json:"account"`
ChsName string `json:"chsName"`
EngName string `json:"engName"`
Gender int `json:"gender"`
OrgId int `json:"orgId"`
Mobile string `json:"mobile"`
Phone string `json:"phone"`
Email string `json:"email"`
CustomAttr string `json:"customAttr"`
} `json:"userInfo"`
}
type MediaGetResp ¶
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func NewMessage ¶
type Pkcs7 ¶
type Pkcs7 struct {
// contains filtered or unexported fields
}
Pkcs7 is used to padding and unpadding messages.
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func NewResponse ¶
func (*Response) StatusCode ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
type SetAuthResp ¶
type SimpleUserInfo ¶
type User ¶
type User struct {
// contains filtered or unexported fields
}
func (*User) EnableState ¶
EnableState 查询用户激活状态
func (*User) Get ¶
Get 获取用户信息 see: https://youdu.im/doc/api/c01_00013.html#_6
func (*User) SimpleList ¶
func (u *User) SimpleList(deptId int) ([]SimpleUserInfo, error)
SimpleList 获取部门用户
type UserInfo ¶
type UserInfo struct {
Gid int `json:"gid"`
UserId string `json:"userId"`
Name string `json:"name"`
Gender int `json:"gender"` // 性别。0表示男性,1表示女性
Mobile string `json:"mobile"`
Phone string `json:"phone"`
Email string `json:"email"`
Dept []int `json:"dept"`
DeptDetail []struct {
DeptId int `json:"deptId"`
DeptName string `json:"deptName"`
Position string `json:"position"`
Weight int `json:"weight"`
SortId int `json:"sortId"`
} `json:"deptDetail"`
Attrs []interface{} `json:"attrs"`
}
type Youdu ¶
type Youdu struct {
// contains filtered or unexported fields
}
func (*Youdu) AccessToken ¶
AccessToken 返回 accessToken
Source Files
¶
Click to show internal directories.
Click to hide internal directories.