Documentation
¶
Index ¶
- type BeerInteractor
- func (interactor *BeerInteractor) CreateBeer(ctx context.Context, params *domain.CreateBeerParams) (*domain.Beer, error)
- func (interactor *BeerInteractor) DeleteBeer(ctx context.Context, params *domain.DeleteBeerParams) error
- func (interactor *BeerInteractor) GetBeer(ctx context.Context, params *domain.GetBeerParams) (*domain.Beer, error)
- func (interactor *BeerInteractor) ListBeers(ctx context.Context, params *domain.ListBeersParams) ([]*domain.Beer, error)
- func (interactor *BeerInteractor) UpdateBeer(ctx context.Context, params *domain.UpdateBeerParams) (*domain.Beer, error)
- type BeerRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeerInteractor ¶
type BeerInteractor struct {
// contains filtered or unexported fields
}
BeerInteractor describes a set of APIs for interacting with beers.
func NewBeerInteractor ¶
func NewBeerInteractor(repo BeerRepository) *BeerInteractor
NewBeerInteractor creates a new beer interactor.
func (*BeerInteractor) CreateBeer ¶
func (interactor *BeerInteractor) CreateBeer(ctx context.Context, params *domain.CreateBeerParams) (*domain.Beer, error)
CreateBeer is an API for getting a beer given its ID.
func (*BeerInteractor) DeleteBeer ¶
func (interactor *BeerInteractor) DeleteBeer(ctx context.Context, params *domain.DeleteBeerParams) error
DeleteBeer is an API for deleting a beer given its ID.
func (*BeerInteractor) GetBeer ¶
func (interactor *BeerInteractor) GetBeer(ctx context.Context, params *domain.GetBeerParams) (*domain.Beer, error)
GetBeer is an API for getting a beer given its ID.
func (*BeerInteractor) ListBeers ¶
func (interactor *BeerInteractor) ListBeers(ctx context.Context, params *domain.ListBeersParams) ([]*domain.Beer, error)
ListBeers is an API for listing beers.
func (*BeerInteractor) UpdateBeer ¶
func (interactor *BeerInteractor) UpdateBeer(ctx context.Context, params *domain.UpdateBeerParams) (*domain.Beer, error)
UpdateBeer is an API for updating a beer given its ID.
type BeerRepository ¶
type BeerRepository interface {
// CreateBeer creates a beer.
CreateBeer(ctx context.Context, params *domain.CreateBeerParams) (*domain.Beer, error)
// GetBeer gets a beer.
GetBeer(ctx context.Context, params *domain.GetBeerParams) (*domain.Beer, error)
// UpdateBeer updates a beer.
UpdateBeer(ctx context.Context, params *domain.UpdateBeerParams) (*domain.Beer, error)
// DeleteBeer deletes a beer.
DeleteBeer(ctx context.Context, params *domain.DeleteBeerParams) error
// ListBeers lists beers.
ListBeers(ctx context.Context, params *domain.ListBeersParams) ([]*domain.Beer, error)
}
BeerRepository is a repository for beers.
Click to show internal directories.
Click to hide internal directories.