Documentation ¶
Index ¶
- func IsUnique(username string) (bool, error)
- type OAuth
- type Sessions
- type User
- func GetAll(limit, offset int) ([]User, error)
- func GetUserFromSession(session string) (*User, error)
- func GetUserFromUserId(id uint32) (*User, error)
- func GetUserFromUsername(username string) (*User, error)
- func New(userid uint32) *User
- func NewAuthentication(username string) *User
- func NewRegistration(username, email string) *User
- func (u *User) Create() error
- func (u *User) Created() *time.Time
- func (u *User) Deleted() *time.Time
- func (u *User) DoHashesMatch(password string) (bool, error)
- func (u *User) Email() string
- func (u *User) Hash() string
- func (u *User) OAuths() []OAuth
- func (u *User) Save() error
- func (u *User) Secret() (string, error)
- func (u *User) SessionToken() string
- func (u *User) SetEmail(email string)
- func (u *User) SetHash(hash string)
- func (u *User) SetOAuths(oauths []OAuth)
- func (u *User) SetSessionToken(sessionToken string)
- func (u *User) SetTotpSecret(secret string)
- func (u *User) SetUsername(username string)
- func (u *User) TotpSecret() string
- func (u *User) Updated() *time.Time
- func (u *User) UserId() uint32
- func (u *User) Username() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type OAuth ¶
type OAuth struct { UserID uint32 `persistence:"primary;references:user(userid)" ` Username string `json:"username"` AvatarURL string `json:"avatar"` Provider string `json:"provider" persistence:"primary"` ProviderID string `json:"provider_id"` Token *oauth2.Token `json:"-" persistence:"-"` Session string `json:"session,omitempty"` }
type Sessions ¶
type Sessions struct {
// contains filtered or unexported fields
}
Sessions is the collection of receipts
func NewSessions ¶
func NewSessions() *Sessions
IntializeDatabase creates or updates the session table and then creates the DAO
func (*Sessions) IsConnected ¶
IsConnected takes in a user to see if they are logged in
func (*Sessions) RemoveSession ¶
RemoveSession takes in a user and remove their session token
func (*Sessions) UpdateSession ¶
UpdateSession takes in a user and updates their session token
type User ¶
type User struct {
// contains filtered or unexported fields
}
func GetUserFromSession ¶
func GetUserFromUserId ¶
func GetUserFromUsername ¶
func NewAuthentication ¶
func NewRegistration ¶
func (*User) DoHashesMatch ¶
DoHashesMatch validates that a provided password hashes to the encrypted hash stored in the database
func (*User) SessionToken ¶
func (*User) SetSessionToken ¶
func (*User) SetTotpSecret ¶
func (*User) SetUsername ¶
func (*User) TotpSecret ¶
Click to show internal directories.
Click to hide internal directories.