Documentation ¶
Index ¶
- type BaseDatastore
- type CreatePictureInput
- type CreateUserInput
- type DAO
- func (dao *DAO) CreatePicture(input CreatePictureInput) (*Picture, error)
- func (dao *DAO) CreateUser(input CreateUserInput) (*User, error)
- func (dao *DAO) DeletePicture(input DeletePictureInput) error
- func (dao *DAO) DeleteUser(input DeleteUserInput) error
- func (dao *DAO) ReadPicture(input ReadPictureInput) (*Picture, error)
- func (dao *DAO) ReadUser(input ReadUserInput) (*User, error)
- func (dao *DAO) UpdatePicture(input UpdatePictureInput) (*Picture, error)
- func (dao *DAO) UpdateUser(input UpdateUserInput) (*User, error)
- type Datastore
- type DeletePictureInput
- type DeleteUserInput
- type ErrPictureNotFound
- type ErrUserNotFound
- type Picture
- type ReadPictureInput
- type ReadUserInput
- type UpdatePictureInput
- type UpdateUserInput
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseDatastore ¶
type BaseDatastore interface { CreateUser(input CreateUserInput) (*User, error) ReadUser(input ReadUserInput) (*User, error) UpdateUser(input UpdateUserInput) (*User, error) DeleteUser(input DeleteUserInput) error CreatePicture(input CreatePictureInput) (*Picture, error) ReadPicture(input ReadPictureInput) (*Picture, error) UpdatePicture(input UpdatePictureInput) (*Picture, error) DeletePicture(input DeletePictureInput) error }
BaseDatastore provides the basic datastore methods
type CreatePictureInput ¶
CreatePictureInput enapsulates the information required to create a single picture in the datastore
type CreateUserInput ¶
CreateUserInput encapsulates the information required to create a single user in the datastore
type DAO ¶
DAO encapsulates access to the datastore
func (*DAO) CreatePicture ¶
func (dao *DAO) CreatePicture(input CreatePictureInput) (*Picture, error)
CreatePicture new picture in the datastore, returning the newly created picture
func (*DAO) CreateUser ¶
func (dao *DAO) CreateUser(input CreateUserInput) (*User, error)
CreateUser creates a new user in the datastore, returning the newly created user
func (*DAO) DeletePicture ¶
func (dao *DAO) DeletePicture(input DeletePictureInput) error
DeletePicture deletes a single picture from the datastore
func (*DAO) DeleteUser ¶
func (dao *DAO) DeleteUser(input DeleteUserInput) error
DeleteUser deletes a user in the datastore
func (*DAO) ReadPicture ¶
func (dao *DAO) ReadPicture(input ReadPictureInput) (*Picture, error)
ReadPicture returns the picture in the datastore for a given ID
func (*DAO) ReadUser ¶
func (dao *DAO) ReadUser(input ReadUserInput) (*User, error)
ReadUser returns the user in the datastore for a given ID
func (*DAO) UpdatePicture ¶
func (dao *DAO) UpdatePicture(input UpdatePictureInput) (*Picture, error)
UpdatePicture updates a picture in the datastore, returning an error if it fails
func (*DAO) UpdateUser ¶
func (dao *DAO) UpdateUser(input UpdateUserInput) (*User, error)
UpdateUser updates a user in the datastore, returning an error if it fails
type Datastore ¶
type Datastore interface { BaseDatastore }
Datastore provides the interface adopted by the DAO, allowing for mocking
type DeletePictureInput ¶
DeletePictureInput encapsulates the information required to delete a single picture in the datastore
type DeleteUserInput ¶
DeleteUserInput encapsulates the information required to delete a single user in the datastore
type ErrPictureNotFound ¶
type ErrPictureNotFound string
ErrPictureNotFound is returned when a picture for the provided ID was not found
func (ErrPictureNotFound) Error ¶
func (e ErrPictureNotFound) Error() string
type ErrUserNotFound ¶
type ErrUserNotFound string
ErrUserNotFound is returned when a user for the provided ID was not found
func (ErrUserNotFound) Error ¶
func (e ErrUserNotFound) Error() string
type ReadPictureInput ¶
ReadPictureInput enapsulates the information required to read a single picture in the datastore
type ReadUserInput ¶
ReadUserInput encapsulates the information required to read a single user in the datastore
type UpdatePictureInput ¶
UpdatePictureInput enapsulates the information required to update a single picture in the datastore
type UpdateUserInput ¶
UpdateUserInput encapsulates the information required to update a single user in the datastore