entity

package
v0.0.0-...-1b98d54 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyIngredientsList = errors.New("Empty ingredients list")

ErrEmptyIngredientsList empty ingredients

View Source
var ErrEmptyName = errors.New("invalid empty name")

ErrEmptyName invalid empty name

View Source
var ErrEmptyOwner = errors.New("invalid empty owner")

ErrEmptyOwner empty owner

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound not found

Functions

This section is empty.

Types

type ID

type ID = uuid.UUID

ID entity ID

func NewID

func NewID() ID

NewID create a new entity ID

func StringToID

func StringToID(s string) (ID, error)

StringToID convert a string to an entity ID

type Ingredient

type Ingredient string

Ingredient data

type Order

type Order struct {
	ID        ID
	Pizzas    []Pizza
	Owner     string
	CreatedAt time.Time
}

Order -

func NewOrder

func NewOrder(owner string, pizzas []Pizza) (*Order, error)

NewOrder creates a new order

type Pizza

type Pizza struct {
	ID          ID
	Name        string
	Ingredients []Ingredient
	CreatedAt   time.Time
}

Pizza data

func NewPizza

func NewPizza(name string, ingredients []Ingredient) (*Pizza, error)

NewPizza create a new pizza

func (*Pizza) GetIngredientsAsString

func (p *Pizza) GetIngredientsAsString() string

GetIngredientsAsString function

func (*Pizza) SetIngredientsAsList

func (p *Pizza) SetIngredientsAsList(ingredients string) *Pizza

SetIngredientsAsList function

Jump to

Keyboard shortcuts

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