Documentation ¶
Index ¶
- type Gist
- type User
- func (u *User) Available() bool
- func (u *User) CreatedGists() []string
- func (u *User) EncodedUsername() string
- func (u *User) EqualsPassword(password string) bool
- func (u *User) GetPasswordDigest() string
- func (u *User) GetUUID() string
- func (u *User) GetUsername() string
- func (u *User) MarkGist(UUID string) bool
- func (u *User) MarkedGists() []string
- func (u *User) ResetUUID() string
- func (u *User) Save() bool
- func (u *User) SetPassword(password string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gist ¶
type Gist struct {
UUID string
}
Gist model
func (*Gist) AddSnippets ¶
AddSnippets appends new compressed snippets.
func (*Gist) GetSnippets ¶
GetSnippets returns all uncompressed snippets which are associated to self.
type User ¶
type User struct { UUID string Username string PasswordDigest string }
User model
func FindUserByName ¶
FindUserByName will look for a user and will return it available. Otherwise it returns an error.
func FindUserByUUID ¶
FindUserByUUID will look for a user and will return it available. Otherwise it returns an error.
func NewUser ¶
func NewUser(username string, password string) User
NewUser returns new user instance
func (*User) CreatedGists ¶
func (u *User) CreatedGists() []string
CreatedGists returns a list with gist id's
func (*User) EncodedUsername ¶
func (u *User) EncodedUsername() string
EncodedUsername encodes the username into base64 to prevent to handle each kind of username.
func (*User) EqualsPassword ¶
EqualsPassword verifies password
func (*User) GetPasswordDigest ¶
func (u *User) GetPasswordDigest() string
GetPasswordDigest returns the objects internal passwordDigest or prefetch them from datastore
func (*User) GetUUID ¶
func (u *User) GetUUID() string
GetUUID returns the objects internal UUID or prefetch them from datastore
func (*User) GetUsername ¶
func (u *User) GetUsername() string
GetUsername returns the objects internal username or prefetch them from datastore
func (*User) MarkedGists ¶
func (u *User) MarkedGists() []string
MarkedGists returns a list of marked gists.
func (*User) ResetUUID ¶
func (u *User) ResetUUID() string
ResetUUID sets a new UUID to current user.
func (*User) SetPassword ¶
func (u *User) SetPassword(password string)
SetPassword calculates a bcrypt hash and updates objects PasswordDigest.