Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotExist is returned when a user does not exist ErrNotExist = errors.New("user does not exist") )
Functions ¶
This section is empty.
Types ¶
type Credentials ¶ added in v0.8.0
type Credentials struct { Login string `json:"login"` // Username or Email Password string `json:"password"` // Password }
Credentials holds credential data
type Device ¶
type Device struct { ID int `json:"id" storm:"id,increment"` // device id Name string `json:"name" storm:"unique"` // device slug Host string `json:"host" storm:"unique"` // device url Title string `json:"title"` Sockets []struct { Type string `json:"type"` // type string representation, i.e. for providing proper icons Description string `json:"description"` // human readable socket description } `json:"sockets"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Device holds device data
type User ¶
type User struct { ID int `json:"id" storm:"id,increment"` // user id Username string `json:"username" storm:"unique"` // user name Password string `json:"-"` // encrypted password Email string `json:"email" storm:"unique"` Name string `json:"name"` Admin bool `json:"admin"` Role string `json:"role"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
User holds a user data
func (*User) Authenticate ¶ added in v0.6.0
Authenticate a user from a password
Click to show internal directories.
Click to hide internal directories.