domain

package
Version: 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: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Beer

type Beer struct {
	ID      string
	Name    string
	Type    BeerType
	Brewer  string
	Country string
}

Beer is a definition of a beer.

func (*Beer) Validate

func (b *Beer) Validate() error

Validate validates a beer.

type BeerType

type BeerType int

BeerType describes the beer type.

const (
	// Unspecified beer type
	Unspecified BeerType = iota + 1 // Unspecified beer type
	// Ale is a beer type, see  https://en.wikipedia.org/wiki/Ale
	Ale
	// Bitter is a beer type, see https://en.wikipedia.org/wiki/Bitter_(beer)
	Bitter
	// Lager is a beer type, see  https://en.wikipedia.org/wiki/Lager
	Lager
	// IndiaPaleAle (IPA) is a beer type, see https://en.wikipedia.org/wiki/India_pale_ale
	IndiaPaleAle
	// Stout is a beer type, see https://en.wikipedia.org/wiki/Stout
	Stout
	// Pilsner is a beer type, see https://en.wikipedia.org/wiki/Pilsner
	Pilsner
	// Porter is a beer type, see https://en.wikipedia.org/wiki/Porter_(beer)
	Porter
	// PaleAle is a beer type, see https://en.wikipedia.org/wiki/Pale_ale
	PaleAle
)

func (BeerType) String

func (t BeerType) String() string

String returns the string representation of a beer type.

type CreateBeerParams

type CreateBeerParams struct {
	Name    string
	Type    BeerType
	Brewer  string
	Country string
}

CreateBeerParams describes parameters for creating a beer.

func (*CreateBeerParams) Validate

func (b *CreateBeerParams) Validate() error

Validate validates the CreateBeerParams.

type DeleteBeerParams

type DeleteBeerParams struct {
	ID string
}

DeleteBeerParams describes parameters for deleting a beer.

func (*DeleteBeerParams) Validate

func (b *DeleteBeerParams) Validate() error

Validate validates the DeleteBeerParams.

type GetBeerParams

type GetBeerParams struct {
	ID string
}

GetBeerParams describes parameters for getting a beer.

func (*GetBeerParams) Validate

func (b *GetBeerParams) Validate() error

Validate validates the GetBeerParams.

type ListBeersParams

type ListBeersParams struct {
	// Page is the page number of the beers.
	Page int
}

ListBeersParams describes parameters for listing beers.

func (*ListBeersParams) Validate

func (b *ListBeersParams) Validate() error

Validate validates the ListBeersParams.

type UpdateBeerParams

type UpdateBeerParams struct {
	ID      string
	Name    *string
	Type    *BeerType
	Brewer  *string
	Country *string
}

UpdateBeerParams describes parameters for updating a beer.

func (*UpdateBeerParams) Validate

func (b *UpdateBeerParams) Validate() error

Validate validates the UpdateBeerParams.

type ValidationError

type ValidationError struct {
	// contains filtered or unexported fields
}

ValidationError is a validation error.

func NewValidationError

func NewValidationError(msg string) ValidationError

NewValidationError returns a new ValidationError.

func (ValidationError) Error

func (e ValidationError) Error() string

Error returns the validation error string.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL