Documentation ¶
Index ¶
- Variables
- func ConnectDB()
- func CreateSchema(db *pg.DB) error
- func DeleteThreadById(id int64) error
- func DeleteUserById(id int64) error
- func GetAll(model *ListableModel) error
- func Migrate() error
- func WrapDBQueryError(err error) error
- type AuthenticationError
- type GettableModel
- type Link
- type ListableModel
- type PermissionsError
- type Thread
- func (t Thread) AddLink(link *Link) error
- func (t Thread) AddUser(user *User) error
- func (t Thread) RemoveLink(link *Link) error
- func (t Thread) RemoveUser(user *User) error
- func (t Thread) String() string
- func (t Thread) UpdateModel() error
- func (t Thread) UpdateTitle(title string) error
- func (t Thread) UserIsSubscribed(user User) bool
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var Database *pg.DB
Functions ¶
func CreateSchema ¶
func DeleteThreadById ¶
func DeleteUserById ¶
func GetAll ¶
func GetAll(model *ListableModel) error
func WrapDBQueryError ¶
Types ¶
type AuthenticationError ¶
Used for when the user was unable to be authenticated.
func (*AuthenticationError) Error ¶
func (e *AuthenticationError) Error() string
type GettableModel ¶
type GettableModel interface {
GetById() *GettableModel
}
type ListableModel ¶
type ListableModel interface { GetAllModels() []*ListableModel GetAllByFilter() []*ListableModel }
type PermissionsError ¶
Used for when the user doesn't have the correct permissions to perform an action.
func (*PermissionsError) Error ¶
func (e *PermissionsError) Error() string
type Thread ¶
func GetAllThreads ¶
func GetThreadById ¶
func GetThreadByTitle ¶
func (Thread) RemoveLink ¶
func (Thread) RemoveUser ¶
func (Thread) UpdateModel ¶
func (Thread) UpdateTitle ¶
func (Thread) UserIsSubscribed ¶
type User ¶
func GetAllUsers ¶
func GetUserByEmail ¶
func GetUserById ¶
func GetUserByUsername ¶
func (User) UpdateEmail ¶
func (User) UpdateName ¶
Click to show internal directories.
Click to hide internal directories.