Documentation
¶
Index ¶
- Variables
- type Snippet
- type SnippetModel
- type SnippetModelInterface
- type User
- type UserModel
- func (m *UserModel) Authenticate(email, password string) (int, 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) error
- func (m *UserModel) PasswordUpdate(id int, currentPassword, newPassword string) error
- type UserModelInteraface
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type SnippetModel ¶
SnippetModel type wraps a sql.Db connection pool.
func (*SnippetModel) Get ¶
func (m *SnippetModel) Get(id int) (*Snippet, error)
Get return a specific snippet based on its id.
func (*SnippetModel) Latest ¶
func (m *SnippetModel) Latest() ([]*Snippet, error)
Latest return the 10 most recently created snippets.
type SnippetModelInterface ¶
type UserModel ¶
User Model wraps a database connection pool.
func (*UserModel) Authenticate ¶
Authenticate method verifys whether a user exitsts with the provided emal address and password. It returns the relevant user ID if they do.
Click to show internal directories.
Click to hide internal directories.