usecases

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL