Versions in this module Expand all Collapse all v0 v0.1.1 Feb 5, 2020 Changes in this version type Departments + func (z Departments) Len() int + func (z Departments) Less(i, j int) bool + func (z Departments) Swap(i, j int) v0.1.0 May 18, 2019 Changes in this version + var ErrEmptyArg = errors.New("empty argument") + var ErrEmptyCorp = errors.New("empty corpID or corpSecret") + var ErrNotFound = errors.New("not found") + var ErrOutofRange = errors.New("out of range") + type API struct + func New(corpId, corpSecret string) *API + func NewAPI() *API + func (a *API) AddUser(user *User) (err error) + func (a *API) CorpID() string + func (a *API) DeleteUser(userId string) (err error) + func (a *API) GetOAuth2User(agentID int, code string) (ou *OAuth2UserInfo, err error) + func (a *API) GetUser(userId string) (*User, error) + func (a *API) ListDepartment(id int) (data Departments, err error) + func (a *API) ListUser(deptId int, incChild bool) (data []User, err error) + type CAPI struct + func NewCAPI() *CAPI + func (a *CAPI) ListCheckin(days int, userIDs ...string) (result *CheckInResult, err error) + type CheckInData struct + CheckInTime int64 + CheckInType string + ExceptionType string + GroupName string + LocationDetail string + LocationTitle string + Mediaids []string + Notes string + UserID string + WifiMac string + WifiName string + type CheckInReq struct + EndTime int64 + OpenCheckInDataType int + StartTime int64 + UserIdList []string + type CheckInResult struct + CheckInData []CheckInData + ErrCode int + ErrMsg string + type Department struct + Id int + Name string + Order int + ParentId int + func FilterDepartment(data []Department, id int) (*Department, error) + type Departments []Department + func (z Departments) WithID(id int) *Department + type OAuth2UserInfo struct + DeviceID string + OpenId string + UserID string + UserTicket string + type Status uint8 + const SActived + const SInactive + const SNone + const SUnlit + func (s Status) String() string + type User struct + Alias string + Avatar string + DepartmentIds []int + Email string + Enabled int8 + EnglishName string + ExtAttr UserAttributes + ExternalPosition string + Gender gender.Gender + IsLeader uint8 + LeaderDepts []int + Mobile string + Name string + Status Status + Tel string + Title string + UID string + func (u User) IsActived() bool + func (u User) IsEnabled() bool + type UserAttribute struct + Name string + Value string + type UserAttributes struct + Attrs []*UserAttribute