Documentation
¶
Index ¶
- Constants
- Variables
- func NsAccessKey(uname, id string) []byte
- func NsAppInstance(id string) []byte
- func NsAuthCode(code string) []byte
- func NsMsgQueue(id string) []byte
- func NsMsgSent(id string) []byte
- func NsRole(name string) []byte
- func NsRolePrivilege(role, appid string) []byte
- func NsSysConfig(name string) []byte
- func NsUser(uname string) []byte
- func NsUserAuthDeny(uname, remoteIp string) []byte
- func NsUserProfile(uname string) []byte
- func NsUserResetPassword(id string) []byte
- func NsUserSession(uname string, created uint32) []byte
- func ServiceRedirectTokenValid(tokenstr string) bool
- func UserNameFilter(name string) string
- type AppInstance
- type AppPermission
- type ServiceRedirectToken
- type SignInAuthCode
- type SysConfigMailer
- type User
- type UserProfile
- type UserResetPassword
- type UserRole
- type Validator
Constants ¶
View Source
const ( Role_Sysadmin = "sa" Role_User = "user" Role_Guest = "guest" Role_Developer = "dev" )
View Source
const ( UserSysadmin = "sysadmin" DefaultPassword = "changeme" )
View Source
const ( UserKeyDefault = "std" UserTypeGroup = "group" )
Variables ¶
View Source
var ( ErrCodeAccessDenied = "AccessDenied" ErrCodeInvalidArgument = "InvalidArgument" ErrCodeServerError = "ServerError" ErrCodeInternalError = "InternalError" ErrCodeNotFound = "NotFound" )
Functions ¶
func NsAccessKey ¶
func NsAppInstance ¶
func NsAuthCode ¶
func NsMsgQueue ¶
func NsRolePrivilege ¶
func NsSysConfig ¶
func NsUserAuthDeny ¶
func NsUserProfile ¶
func NsUserResetPassword ¶
func NsUserSession ¶
func UserNameFilter ¶
Types ¶
type AppInstance ¶
type AppInstance struct {
ID string `json:"id,omitempty" toml:"id,omitempty"`
Name string `json:"name" toml:"name"`
User string `json:"user,omitempty" toml:"user,omitempty"`
Version string `json:"version,omitempty" toml:"version,omitempty"`
Status uint8 `json:"status,omitempty" toml:"status,omitempty"`
Url string `json:"url,omitempty" toml:"url,omitempty"`
Permissions []*AppPermission `json:"permissions,omitempty" toml:"permissions,omitempty"`
SecretKey string `json:"secret_key,omitempty" toml:"secret_key,omitempty"`
Created int64 `json:"created,omitempty" toml:"created,omitempty"`
Updated int64 `json:"updated,omitempty" toml:"updated,omitempty"`
}
type AppPermission ¶
type ServiceRedirectToken ¶
type ServiceRedirectToken struct {
RedirectUri string `json:"uri,omitempty" toml:"uri,omitempty"`
State string `json:"state,omitempty" toml:"state,omitempty"`
ClientId string `json:"cid,omitempty" toml:"cid,omitempty"`
Persistent int `json:"pt,omitempty" toml:"pt,omitempty"`
}
func ServiceRedirectTokenDecode ¶
func ServiceRedirectTokenDecode(tokenstr string) ServiceRedirectToken
func (*ServiceRedirectToken) Encode ¶
func (s *ServiceRedirectToken) Encode() string
type SignInAuthCode ¶
type SysConfigMailer ¶
type User ¶
type User struct {
Name string `json:"name" toml:"name"`
Email string `json:"email,omitempty" toml:"email,omitempty"`
DisplayName string `json:"display_name,omitempty" toml:"display_name,omitempty"`
Keys types.KvPairs `json:"keys,omitempty" toml:"keys,omitempty"`
Roles []string `json:"roles,omitempty" toml:"roles,omitempty"`
Type string `json:"type,omitempty" toml:"type,omitempty"`
Owners []string `json:"owners,omitempty" toml:"owners,omitempty"`
Members []string `json:"members,omitempty" toml:"members,omitempty"`
Status uint8 `json:"status,omitempty" toml:"status,omitempty"`
Created int64 `json:"created,omitempty" toml:"created,omitempty"`
Updated int64 `json:"updated,omitempty" toml:"updated,omitempty"`
}
type UserProfile ¶
type UserProfile struct {
Login *User `json:"login,omitempty" toml:"login,omitempty"`
DisplayName string `json:"display_name,omitempty" toml:"display_name,omitempty"`
Email string `json:"email,omitempty" toml:"email,omitempty"`
Gender uint8 `json:"gender,omitempty" toml:"gender,omitempty"`
Birthday string `json:"birthday,omitempty" toml:"birthday,omitempty"`
About string `json:"about,omitempty" toml:"about,omitempty"`
Photo string `json:"photo,omitempty" toml:"photo,omitempty"`
PhotoSource string `json:"photo_source,omitempty" toml:"photo_source,omitempty"`
Updated int64 `json:"updated,omitempty" toml:"updated,omitempty"`
}
type UserResetPassword ¶
type UserRole ¶
type UserRole struct {
Name string `json:"name" toml:"name"`
User string `json:"user,omitempty" toml:"user,omitempty"`
Status uint8 `json:"status,omitempty" toml:"status,omitempty"`
Desc string `json:"desc,omitempty" toml:"desc,omitempty"`
Permissions []string `json:"permissions,omitempty" toml:"permissions,omitempty"`
Created int64 `json:"created,omitempty" toml:"created,omitempty"`
Updated int64 `json:"updated,omitempty" toml:"updated,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.