Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPasswordTooLong = errors.New("password too long") ErrPasswordContainsUnsuportedCharacters = errors.New("password contains unsuported characters") ErrInvalidUsername = errors.New("invalid username") AUTH_BASE_USER = Authority{AuthName: "User", Level: 0} AUTH_MODERATOR = Authority{AuthName: "Moderator", Level: 1} AUTH_ADMIN = Authority{AuthName: "Admin", Level: 255} )
Functions ¶
This section is empty.
Types ¶
type Article ¶
func (*Article) AfterCreate ¶
AfterCreate is a hook that creates a post after creating an article It helps indexing posts arbitrarily
type BasePost ¶
type BasePost struct { ID uint64 Title string Author string User User `gorm:"foreignKey:Author;references:Username"` Published bool CreatedAt time.Time UpdatedAt time.Time }
func (BasePost) GetCreatedAt ¶
func (BasePost) GetUpdatedAt ¶
type FollowList ¶
type Password ¶
func (*Password) ComparePassword ¶
func (*Password) SetPasswordAsHash ¶
func (*Password) ValidateAndSetPassword ¶
type Post ¶
type Postable ¶
type Postable interface { GetID() uint64 GetTitle() string GetAuthor() string GetCreatedAt() time.Time GetUpdatedAt() time.Time GetVotes() []Vote }
Postable is an interface that all posts must implement It allows to easily index posts in a single slice
type Project ¶
type Tag ¶
func (*Tag) ColorOfTag ¶
type User ¶
type User struct { ID uint64 Username string `gorm:"unique"` Password Password `gorm:"embedded"` Profile Profile `gorm:"embedded"` Email string CreatedAt time.Time UpdatedAt time.Time FullName string FollowList FollowList `gorm:"foreignKey:Owner;references:Username"` Active bool `gorm:"default:true"` Authority }
func (*User) ValidateAndSetUsername ¶
Click to show internal directories.
Click to hide internal directories.