beerscli

package
v0.0.0-...-28705da Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 1 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 {
	ProductID int       `json:"product_id"`
	Name      string    `json:"name"`
	Price     string    `json:"price"`
	BeerID    int       `json:"beer_id"`
	Category  string    `json:"category"`
	Type      *BeerType `json:"type"`
	Brewer    string    `json:"brewer"`
	Country   string    `json:"country"`
}

Beer representation of beer into data struct

func NewBeer

func NewBeer(productID int, name, category, brewer, country string, price string, beerType *BeerType) (b Beer)

NewBeer initialize struct beer

type BeerRepo

type BeerRepo interface {
	GetBeers() ([]Beer, error)
}

BeerRepo definition of methods to access a data beer

type BeerType

type BeerType int
const (
	Unknown BeerType = iota
	Lager
	Malt
	Ale
	FlavouredMalt
	Stout
	Porter
	NonAlcoholic
)

func NewBeerType

func NewBeerType(t string) *BeerType

NewBeerType initialize a type from enum beerTypes

func (BeerType) String

func (t BeerType) String() string

func (*BeerType) UnmarshalJSON

func (t *BeerType) UnmarshalJSON(b []byte) error

Directories

Path Synopsis
storage
csv

Jump to

Keyboard shortcuts

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