Documentation ¶
Index ¶
- type BaseDatastore
- type CreateMatchInput
- type DAO
- func (dao *DAO) CreateMatch(input CreateMatchInput) (*Match, error)
- func (dao *DAO) DeleteMatch(input DeleteMatchInput) error
- func (dao *DAO) ListMatch(input ListMatchInput) (*[]Match, error)
- func (dao *DAO) ReadMatch(input ReadMatchInput) (*Match, error)
- func (dao *DAO) UpdateMatch(input UpdateMatchInput) (*Match, error)
- type Datastore
- type DeleteMatchInput
- type ErrMatchNotFound
- type ListMatchInput
- type Match
- type ReadMatchInput
- type UpdateMatchInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseDatastore ¶
type BaseDatastore interface { ListMatch(input ListMatchInput) (*[]Match, error) CreateMatch(input CreateMatchInput) (*Match, error) ReadMatch(input ReadMatchInput) (*Match, error) UpdateMatch(input UpdateMatchInput) (*Match, error) DeleteMatch(input DeleteMatchInput) error }
BaseDatastore provides the basic datastore methods
type CreateMatchInput ¶
type CreateMatchInput struct { ID uuid.UUID AuthID uuid.UUID UserOne uuid.UUID UserTwo uuid.UUID MatchedOn time.Time }
CreateMatchInput encapsulates the information required to create a single match in the datastore
type DAO ¶
DAO encapsulates access to the datastore
func (*DAO) CreateMatch ¶
func (dao *DAO) CreateMatch(input CreateMatchInput) (*Match, error)
CreateMatch creates a new match in the datastore, returning the newly created match
func (*DAO) DeleteMatch ¶
func (dao *DAO) DeleteMatch(input DeleteMatchInput) error
DeleteMatch deletes a match in the datastore
func (*DAO) ListMatch ¶
func (dao *DAO) ListMatch(input ListMatchInput) (*[]Match, error)
ListMatch returns a list containing every match in the datastore for a given ID
func (*DAO) ReadMatch ¶
func (dao *DAO) ReadMatch(input ReadMatchInput) (*Match, error)
ReadMatch returns the match in the datastore for a given ID
func (*DAO) UpdateMatch ¶
func (dao *DAO) UpdateMatch(input UpdateMatchInput) (*Match, error)
UpdateMatch updates a match in the datastore, returning the newly updated match
type Datastore ¶
type Datastore interface { BaseDatastore }
Datastore provides the interface adopted by the DAO, allowing for mocking
type DeleteMatchInput ¶
DeleteMatchInput encapsulates the information required to delete a single match in the datastore
type ErrMatchNotFound ¶
type ErrMatchNotFound string
ErrMatchNotFound is returned when a match for the provided ID was not found
func (ErrMatchNotFound) Error ¶
func (e ErrMatchNotFound) Error() string
type ListMatchInput ¶
ListMatchInput encapsulates the information required to read a match list in the datastore
type Match ¶
type Match struct { ID uuid.UUID CreatedBy uuid.UUID UserOne uuid.UUID UserTwo uuid.UUID MatchedOn time.Time }
Match encapsulates the object stored in the datastore
type ReadMatchInput ¶
ReadMatchInput encapsulates the information required to read a single match in the datastore