Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotFound = errors.New("race: resource could not be located")
)
Common errors that you will likely want to account for in your code. Any other errors are wrapped with context vai the github.com/pkg/errors package and returned but are harder to use an if/switch to match.
Functions ¶
Types ¶
type PsqlUserStore ¶
type PsqlUserStore struct {
// contains filtered or unexported fields
}
PsqlUserStore is used to interact with our user store.
func (*PsqlUserStore) Create ¶
func (pus *PsqlUserStore) Create(user *User) error
Create will create a new user in the DB using the provided user and will update the ID of the provided user. If there is an error it will be wrapped and returned.
func (*PsqlUserStore) Delete ¶
func (pus *PsqlUserStore) Delete(id int) error
Delete will delete a user form the DB. If there is an error it will be wrapped and returned.
func (*PsqlUserStore) Find ¶
func (pus *PsqlUserStore) Find(id int) (*User, error)
Find will retrieve a user with the provided ID or return ErrNotFount if the user isn't located. Other errors are wrapped with context but are otherwise wrapped as-is.
func (*PsqlUserStore) Update ¶
func (pus *PsqlUserStore) Update(user *User) error
Update will update a user in the DB with the provided info.