Documentation
¶
Index ¶
Constants ¶
View Source
const ( URIPrefixQqcn = "https://p.qlogo.cn" URIPrefixWxcn = "https://wework.qpic.cn" URIPrefixData = "data:image/jpeg;base64," )
consts
Variables ¶
View Source
var (
EmptyGroup = &Group{"", "", make([]string, 0)}
)
vars
Functions ¶
Types ¶
type Authenticator ¶
type Authenticator interface {
// Authenticate with uid and password
Authenticate(uid, password string) (*People, error)
}
Authenticator for Authenticate
type Group ¶
type Group struct {
Name string `json:"name"`
Description string `json:"description"`
Members []string `json:"members"`
}
Group ...
type GroupStore ¶
type GroupStore interface {
AllGroup() ([]Group, error)
GetGroup(name string) (*Group, error)
SaveGroup(group *Group) error
EraseGroup(name string) error
}
GroupStore Storage for Group
type PasswordStore ¶
type PasswordStore interface {
// Change password by self
PasswordChange(uid, oldPassword, newPassword string) error
// Reset password by administrator
PasswordReset(uid, newPassword string) error
}
PasswordStore Storage for Password
type People ¶
type People struct {
UID string `json:"uid" form:"uid" binding:"required"` // 登录名
CommonName string `json:"cn" form:"cn"` // 姓名(全名,多用在中文)
GivenName string `json:"gn" form:"gn" binding:"required"` // 名 FirstName
Surname string `json:"sn" form:"sn" binding:"required"` // 姓 LastName
Nickname string `json:"nickname,omitempty" form:"nickname"` // 昵称
Birthday string `json:"birthday,omitempty" form:"birthday"` // 生日
Gender string `json:"gender,omitempty" form:"gender"` // 性别: M F U
Email string `json:"email" form:"email" binding:"required"` // 邮箱
Mobile string `json:"mobile" form:"mobile" binding:"required"` // 手机
Tel string `json:"tel,omitempty" form:"tel"` // 座机
EmployeeNumber string `json:"eid,omitempty" form:"eid"` // 员工编号
EmployeeType string `json:"etype,omitempty" form:"etitle"` // 员工岗位
AvatarPath string `json:"avatarPath,omitempty" form:"avatar"` // 头像
JpegPhoto []byte `json:"-" form:"-"` // jpegPhoto data
Description string `json:"description,omitempty" form:"description"` // 描述
JoinDate string `json:"joinDate,omitempty" form:"joinDate"` // 加入日期
IDCN string `json:"idcn,omitempty" form:"idcn"` // 身份证号
Organization string `json:"org,omitempty" form:"org"` // 所属组织
OrgDepartment string `json:"dept,omitempty" form:"dept"` // 所属组织的部门
Created *time.Time `json:"created,omitempty" form:"-"` // 创建时间
Modified *time.Time `json:"modified,omitempty" form:"-"` // 修改时间
DN string `json:"dn,omitempty" form:"-"` // distinguishedName of LDAP entry
}
People employment for a person
type PeopleStore ¶
type PeopleStore interface {
// All browse from store, like LDAP
All(spec *Spec) Peoples
// Get with uid
Get(uid string) (*People, error)
// GetByDN with dn
GetByDN(dn string) (*People, error)
// Delete with uid
Delete(uid string) error
// Save add or update
Save(people *People) (isNew bool, err error)
// ModifyBySelf update by self
ModifyBySelf(uid, password string, people *People) error
}
PeopleStore Storage for People
Click to show internal directories.
Click to hide internal directories.