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(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
- 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 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 Config ¶
type Config struct { Api string Buin int AppId string AesKey string // contains filtered or unexported fields }
func (*Config) GetAccessTokenProvider ¶
func (c *Config) GetAccessTokenProvider() *accessTokenProvider
func (*Config) GetEncryptor ¶
func (c *Config) GetEncryptor() *encryptor
type DecryptResult ¶
type DecryptResult struct { AppId string Data string Length int32 // contains filtered or unexported fields }
func (*DecryptResult) Unmarshal ¶
func (d *DecryptResult) Unmarshal(v interface{}) error
type Group ¶ added in v0.2.0
type Group struct {
// contains filtered or unexported fields
}
func (*Group) RemoveMember ¶ added in v0.2.0
type GroupInfo ¶ added in v0.2.0
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 ¶ added in v0.2.0
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 Media ¶
type Media struct {
// contains filtered or unexported fields
}
type MediaGetResp ¶ added in v0.2.0
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func NewMessage ¶ added in v0.2.0
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 NewResponse(restyResponse *resty.Response) *Response
func (*Response) StatusCode ¶
type Session ¶ added in v0.2.0
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶ added in v0.2.0
type UserInfo ¶ added in v0.2.0
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 ¶ added in v0.2.0
AccessToken 返回 accessToken
Source Files ¶
Click to show internal directories.
Click to hide internal directories.