Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Snippet ¶
Define a Snippet type to hold the data for an individual snippet. Notice how the fields of the struct correspond to the fields in our MySQL snippets tables
type SnippetModel ¶
Define a SnippetModel type which wraps a sql.DB connection pool.
func (*SnippetModel) Get ¶
func (m *SnippetModel) Get(id int) (*Snippet, error)
This will return a specific snippet based on its id.
func (*SnippetModel) Latest ¶
func (m *SnippetModel) Latest() ([]*Snippet, error)
This will return the 10 most recently created snippets.
type SnippetModelInterface ¶
type UserModel ¶
func (*UserModel) Authenticate ¶
Click to show internal directories.
Click to hide internal directories.