Documentation ¶
Index ¶
- func Env(key string, def string) string
- type Invite
- type User
- func (User *User) GenToken(pass string) []byte
- func (User *User) GetName() string
- func (User *User) GetRoles() []string
- func (User User) IsAllow(roles []string) (allow bool)
- func (User User) PassEQ(token []byte) bool
- func (User *User) SetCreated()
- func (User *User) SetToken(pass string) *User
- func (User *User) SetUpdated()
- func (User User) ToBytes() []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Invite ¶ added in v0.1.1
type User ¶
type User struct { ID string `json:"id"` Username string `json:"username"` Email string `json:"email"` Roles []string `json:"roles"` Token []byte `json:"token"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
func NewAdminUser ¶ added in v0.1.1
func NewAdminUser() *User
func (*User) SetCreated ¶ added in v0.1.1
func (User *User) SetCreated()
func (*User) SetUpdated ¶ added in v0.1.1
func (User *User) SetUpdated()
Click to show internal directories.
Click to hide internal directories.