Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ACCOUNT_STATUS_CREATED is the default value for any created account ACCOUNT_STATUS_CREATED = "CREATED" // ACCOUNT_STATUS_MAIL_SEND is the value for any account the activation mail is sent for ACCOUNT_STATUS_MAIL_SEND = "MAIL_SEND" // ACCOUNT_STATUS_VERIFIED is for every account that has a verified email ACCOUNT_STATUS_EMAIL_VERIFIED = "EMAIL_VERIFIED" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { schema.DatabaseObject ActiveAt time.Time `json:"-"` Username string `gorm:"size:128;unique" json:"username"` Email string `gorm:"size:128;unique" json:"email"` Password string `gorm:"size:64" json:"-"` QuotaSongs int64 `json:"quota_songs"` QuotaSpace int64 `json:"quota_space"` EmailActivationCode string `gorm:"size:40" json:"-"` AccountStatus string `gorm:"size:256" json:"-"` AuthProvider string `json:"auth_provider"` DisplayName string `gorm:"size:1024" json:"display_name"` }
func (User) CheckPassword ¶
func (*User) GetAvailableQuota ¶
GetAvailableQuota returns the available quota for a given user. First, it returns available space (in bytes) second, it returns the number of songs the user is allowed to upload until his quota is reached
func (User) MarshalJSON ¶
func (User) QueueSendActivationMail ¶
func (u User) QueueSendActivationMail()
type UserSession ¶
type UserSession struct { schema.DatabaseObject UserID string `gorm:"size:64"` User User Secret string `gorm:"size:128"` UserAgent string `gorm:"size:1024"` ValidUntil time.Time }
UserSession maps a user to a secret to allow him to stay signed in across multiple sessions
func NewUserSessionForUser ¶
func NewUserSessionForUser(user User) UserSession
NewUserSessionForUser returns a new user session for the given user
Click to show internal directories.
Click to hide internal directories.