Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SnippetsService ¶
SnippetsService wraps a sql.DB connection pool.
func (*SnippetsService) Get ¶
func (m *SnippetsService) Get(id int) (models.Snippet, error)
Get will return a specific snippet based on its id.
type UsersService ¶
UsersService wraps a sql.DB connection pool.
func (*UsersService) Authenticate ¶
func (m *UsersService) Authenticate(email, password string) (int, error)
Authenticate verifies a user's email and password. It returns the user's ID if authentication is successful, or an error if it fails.
func (*UsersService) Exists ¶
func (m *UsersService) Exists(id int) (bool, error)
Exists checks if a user with the given ID exists in the database. It returns true if the user exists, or false otherwise.
func (*UsersService) Insert ¶
func (m *UsersService) Insert(name, email, password string) error
Insert adds a new user to the database with the provided name, email, and password. It returns an error if the insertion fails or if the email is already in use.
Click to show internal directories.
Click to hide internal directories.