Versions in this module Expand all Collapse all v1 v1.0.6 Jul 20, 2020 v1.0.5 Jul 15, 2020 Changes in this version + const AES_ENCODE_KEY_LENGTH + const VERSION + func PKCS7Padding(ciphertext []byte, blockSize int) []byte + func PKCS7UnPadding(plantText []byte) []byte + func Sign(ticket string, nonceStr string, timeStamp string, url string) string + type AccessTokenResponse struct + AccessToken string + Created int64 + Expires int + func (e *AccessTokenResponse) CreatedAt() int64 + func (e *AccessTokenResponse) ExpiresIn() int + type Attendance struct + ApproveID int + BaseAccuracy int + BaseAddress string + BaseCheckTime int64 + BaseLatitude float32 + BaseLongitude float32 + BaseMacAddr string + BaseSsid string + CheckType string + ClassId int + CorpID string + DeviceID string + GmtCreate int64 + GmtModifed int64 + GroupID int + ID int64 + IsLegal string + LocaltionMethod string + LocationResult string + OutsideRemark string + PlanCheckTime int64 + PlanID int + ProcInstID string + SourceType string + TimeResult string + UID string + UserAccuracy int + UserAddress string + UserCheckTime int64 + UserLatitude float64 + UserLongitude float64 + UserMacAddr string + UserSsid string + WorkDate int64 + type Cache interface + Get func(data Expirable) error + Set func(data Expirable) error + type CalendarRequest struct + StaffId string + TimeMax CalendarTime + TimeMin CalendarTime + type CalendarTime struct + Date string + TimeZone string + type Callback struct + AES_KEY string + Callbacks []string + Token string + URL string + type Crypto struct + AesKey string + SuiteKey string + Token string + var DefaultDingtalkCrypto *Crypto + func NewCrypto(token, aesKey, suiteKey string) (c *Crypto) + func (c *Crypto) DecryptMsg(signature, timeStamp, nonce, secretStr string) (string, error) + func (c *Crypto) EncryptMsg(replyMsg, timeStamp, nonce string) (string, string, error) + func (c *Crypto) GenerateSignature(token, timeStamp, nonce, secretStr string) string + func (c *Crypto) RandomString(n int, alphabets ...byte) string + func (c *Crypto) VerifySignature(token, timeStamp, nonce, secretStr, sigture string) bool + type DataMessage struct + Data string + type Department struct + DeptManagerUseridList string + DeptPerimits string + Id int + Name string + Order int + OrgDeptOwner string + OuterDept bool + OuterPermitDepts string + OuterPermitUsers string + ParentId int + UserPerimits string + type DepartmentList struct + Departments []Department + type DingTalkClient struct + AccessToken string + AgentID string + Cache Cache + CorpID string + CorpSecret string + HTTPClient *http.Client + PartnerID string + SnsAccessToken string + SnsAppID string + SnsAppSecret string + func NewDingTalkClient(corpID string, corpSecret string) *DingTalkClient + func (c *DingTalkClient) CreateChat(name string, owner string, useridlist []string) (string, error) + func (c *DingTalkClient) CreateFile(size int64) (file FileResponse, err error) + func (c *DingTalkClient) Decrypt(str string) (string, error) + func (c *DingTalkClient) DeleteCallback() error + func (c *DingTalkClient) DepartmentDetail(id int) (Department, error) + func (c *DingTalkClient) DepartmentList() (DepartmentList, error) + func (c *DingTalkClient) DownloadMedia(mediaID string, write io.Writer) error + func (c *DingTalkClient) Encrypt(str string) (string, error) + func (c *DingTalkClient) GetConfig(nonceStr string, timestamp string, url string) string + func (c *DingTalkClient) GetJsAPITicket() (ticket string, err error) + func (c *DingTalkClient) GetMessageReadList(messageID string, cursor int, size int) (data MessageReadListResponse, err error) + func (c *DingTalkClient) GetSnsPersistentCode(tmpAuthCode string) (string, string, string, error) + func (c *DingTalkClient) GetSnsToken(openid, persistentCode string) (string, error) + func (c *DingTalkClient) GetSnsUserInfo(snsToken string) (SnsUserInfoResponse, error) + func (c *DingTalkClient) ListAttendanceRecord(ulist []string, dateFrom time.Time, dateTo time.Time) ([]Attendance, error) + func (c *DingTalkClient) ListAttendanceResult(ulist []string, dateFrom, dateTo time.Time, offset, lmt int64) (listAttendanceResultResp, error) + func (c *DingTalkClient) ListCallback() (Callback, error) + func (c *DingTalkClient) ListEvents(staffid string, from time.Time, to time.Time) (events []Event, err error) + func (c *DingTalkClient) RefreshAccessToken() error + func (c *DingTalkClient) RefreshSnsAccessToken() error + func (c *DingTalkClient) RegisterCallback(callbacks []string, token string, aes_key string, callbackURL string) error + func (c *DingTalkClient) SendAppLinkMessage(agentID, touser string, title, text string, picUrl, url string) error + func (c *DingTalkClient) SendAppMessage(agentID string, touser string, msg string) error + func (c *DingTalkClient) SendAppOAMessage(agentID string, touser string, msg OAMessage) error + func (c *DingTalkClient) SendFileMessage(sender string, cid string, mediaID string) (data MessageResponse, err error) + func (c *DingTalkClient) SendImageMessage(sender string, cid string, mediaID string) (data MessageResponse, err error) + func (c *DingTalkClient) SendLinkMessage(sender string, cid string, mediaID string, url string, title string, ...) (data MessageResponse, err error) + func (c *DingTalkClient) SendOAMessage(sender string, cid string, msg OAMessage) (data MessageResponse, err error) + func (c *DingTalkClient) SendRobotMarkdownMessage(accessToken string, title string, msg string) (data MessageResponse, err error) + func (c *DingTalkClient) SendRobotTextAtMessage(accessToken string, msg string, at *RobotAtList) (data OAPIResponse, err error) + func (c *DingTalkClient) SendRobotTextMessage(accessToken string, msg string) (data MessageResponse, err error) + func (c *DingTalkClient) SendTextMessage(sender string, cid string, msg string) (data MessageResponse, err error) + func (c *DingTalkClient) SendVoiceMessage(sender string, cid string, mediaID string, duration string) (data MessageResponse, err error) + func (c *DingTalkClient) TopAPICreateProcInst(data TopAPICreateProcInst) (string, error) + func (c *DingTalkClient) TopAPIGetProcInst(pid string) (ProcInst, error) + func (c *DingTalkClient) TopAPIListProcInst(processCode string, startTime, endTime time.Time, size, cursor int, ...) (TopAPIListProcInstResp, error) + func (c *DingTalkClient) TopAPIMsgGetSendProgress(taskID int) (TopAPIMsgGetSendProgress, error) + func (c *DingTalkClient) TopAPIMsgGetSendResult(taskID int) (TopAPIMsgGetSendResult, error) + func (c *DingTalkClient) TopAPIMsgSend(msgType string, userList []string, deptList []int, toAll bool, ...) (int, error) + func (c *DingTalkClient) UpdateCallback(callbacks []string, token string, aes_key string, callbackURL string) error + func (c *DingTalkClient) UploadMedia(mediaType string, filename string, reader io.Reader) (media MediaResponse, err error) + func (c *DingTalkClient) UserInfoByCode(code string) (User, error) + func (c *DingTalkClient) UserInfoById(userid string) (UserInfo, error) + func (c *DingTalkClient) UserList(departmentID, offset, size int) (UserList, error) + func (c *DingTalkClient) UseridByMobile(mobile string) (string, error) + func (c *DingTalkClient) UseridByUnionId(unionid string) (string, error) + type DownloadFile struct + FileName string + MediaID string + Reader io.Reader + type Event struct + Description string + End struct{ ... } + Id string + Location string + Start struct{ ... } + Summary string + type Expirable interface + CreatedAt func() int64 + ExpiresIn func() int + type FileCache struct + Path string + func NewFileCache(path string) *FileCache + func (c *FileCache) Get(data Expirable) error + func (c *FileCache) Set(data Expirable) error + type FileResponse struct + Code int + Msg string + UploadID string + Writer io.Writer + type InMemoryCache struct + func NewInMemoryCache() *InMemoryCache + func (c *InMemoryCache) Get(data Expirable) error + func (c *InMemoryCache) Set(data Expirable) error + type JsAPITicketResponse struct + Created int64 + Expires int + Ticket string + func (e *JsAPITicketResponse) CreatedAt() int64 + func (e *JsAPITicketResponse) ExpiresIn() int + type ListEventsResponse struct + Result struct{ ... } + Success bool + type ListProcInst struct + ApproverUIDS []string + BusinessID string + CCUIDS []string + CreateTime string + FinishTime string + FormCompntValues []ProcInstCompntValues + OriginatorDeptID string + OriginatorUID string + ProcInstID string + ProcInstResult string + Status string + Title string + type MediaResponse struct + MediaID string + Type string + Writer io.Writer + type MessageReadListResponse struct + NextCursor int64 + ReadUserIdList []string + type MessageResponse struct + MessageID string + type OAMessage struct + Body struct{ ... } + Head struct{ ... } + PcURL string + URL string + func (m *OAMessage) AppendFormItem(key string, value string) + type OAMessageForm struct + Key string + Value string + type OAMessageRich struct + Num string + Unit string + type OAPIResponse struct + ErrCode int + ErrMsg string + type ProcInst struct + ApproverUIDS []string + BusinessID string + CCUIDS []string + CreateTime string + FinishTime string + FormCompntValues []ProcInstCompntValues + OperationRecords []_ProcInstOperationRecords + OriginatorDeptID string + OriginatorDeptName string + OriginatorUID string + ProcInstID string + Result string + Status string + Tasks []_ProcInstTasks + Title string + type ProcInstCompntValues struct + ExtValue string + Name string + Value string + type RobotAtList struct + AtMobiles []string + IsAtAll bool + type RobotOutgoingMessage struct + AtUsers []struct{ ... } + ChatbotUserID string + ConversationID string + ConversationTitle string + ConversationType string + CreatedAt int64 + MessageID string + MessageType string + SenderCorpID string + SenderID string + SenderNick string + SenderStaffID string + Text struct{ ... } + type SnsPersistentCodeResponse struct + OpenID string + PersistentCode string + UnionID string + type SnsTokenResponse struct + Expires int + SnsToken string + type SnsUserInfoResponse struct + CorpInfo []struct{ ... } + UserInfo struct{ ... } + type TopAPICreateProcInst struct + Approvers []string + CCList []string + CCPosition string + DeptID int + FormCompntValues []ProcInstCompntValues + OriginatorUID string + ProcessCode string + type TopAPIListProcInstResp struct + OK struct{ ... } + RequestID string + type TopAPIMsgGetSendProgress struct + OK struct{ ... } + type TopAPIMsgGetSendResult struct + OK struct{ ... } + type TopAPIResponse interface + type Unmarshallable interface + type UploadFile struct + FieldName string + FileName string + Reader io.Reader + type User struct + Active bool + Avatar string + Department []int + Email string + Extattr interface{} + IsAdmin bool + IsBoss bool + IsLeader bool + IsSys bool + Mobile string + Name string + Order int + Position string + Remark string + SysLevel int + Tel string + Userid string + type UserInfo struct + Active bool + Avatar string + Department []int + Email string + Extattr interface{} + HireDate int + IsAdmin bool + IsBoss bool + IsHide bool + IsLeaderInDepts string + IsSenior bool + Jobnumber string + Mobile string + Name string + OrderInDepts string + OrgEmail string + Position string + RealAuthed bool + Remark string + Roles []UserRole + StateCode string + Tel string + Unionid string + Userid string + WorkPlace string + type UserList struct + HasMore bool + Userlist []User + type UserRole struct + GroupName string + Id int + Name string