Documentation ¶
Index ¶
- Constants
- Variables
- type Review
- type ReviewModel
- type ReviewModelInterface
- type Snippet
- type SnippetModel
- type SnippetModelInterface
- type User
- type UserModel
- func (m *UserModel) Authenticate(email, password string) (int, error)
- func (m *UserModel) Authorize(id int) (bool, error)
- func (m *UserModel) Exists(id int) (bool, error)
- func (m *UserModel) Get(id int) (*User, error)
- func (m *UserModel) Insert(name, email, password string, owner bool) error
- func (m *UserModel) Owner() (bool, error)
- func (m *UserModel) PasswordUpdate(id int, currentPassword, newPassword string) error
- type UserModelInterface
Constants ¶
View Source
const (
PasswordHashCost = 12
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ReviewModel ¶
ReviewModel wraps a database connection pool
func (*ReviewModel) Insert ¶
func (m *ReviewModel) Insert(userID, snippetID int) error
func (*ReviewModel) Update ¶
func (m *ReviewModel) Update(userID, snippetID int) error
type ReviewModelInterface ¶
type SnippetModel ¶
SnippetModel wraps a database connection pool
func (*SnippetModel) Insert ¶
func (m *SnippetModel) Insert(title, content string, expires int) (int, error)
func (*SnippetModel) Latest ¶
func (m *SnippetModel) Latest() ([]*Snippet, error)
type SnippetModelInterface ¶
type UserModel ¶
UserModel wraps a database connection pool
func (*UserModel) Authenticate ¶
type UserModelInterface ¶
type UserModelInterface interface { Insert(name, email, password string, owner bool) error Authenticate(email, password string) (int, error) Authorize(id int) (bool, error) Exists(id int) (bool, error) Get(id int) (*User, error) Owner() (bool, error) PasswordUpdate(id int, currentPassword, newPassword string) error }
Click to show internal directories.
Click to hide internal directories.