Documentation ¶
Index ¶
Constants ¶
View Source
const ( // UserTypeAdmin - can upload content, generate tokens and basically do anything UserTypeAdmin = iota // Customer that can download content with relevant token or with credentials UserTypeUser )
Variables ¶
View Source
var UserFilterFields = []string{"hash"}
UserFilterFields is the list of fields we should filter when sending to clients
Functions ¶
func GetHashFromPassword ¶
GetHashFromPassword returns the hash based on bcrypt
Types ¶
type DownloadLog ¶
type User ¶
type User struct { Username string `json:"username"` Hash string `json:"hash"` Email string `json:"email"` Name string `json:"name"` Type UserType `json:"type"` LastLogin time.Time `json:"lastLogin" db:"last_login"` Token string `json:"token"` ModifyDate time.Time `json:"modifyDate" db:"modify_date"` }
User holds information about a user within the system. A user has a role for each project.
func (*User) SetPassword ¶
SetPassword sets the password on the user with bcrypt
func (*User) UsernameForToken ¶
Click to show internal directories.
Click to hide internal directories.