domain

package
v0.0.0-...-eca6f23 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrItemNotFound is the error returned when the specified item cannot be found.
	ErrItemNotFound = errors.New("item not found")
)

Functions

This section is empty.

Types

type Item

type Item struct {
	ID          string
	Name        string
	Description string
	Price       float64
	// contains filtered or unexported fields
}

Item defines the domain model of an Item. This is the struct that will be used for all business logic. The struct has no annotations because the way the model is rendered to some medium such as an HTTP response, database, queue, etc. should be completely independent of the actual struct used by the business logic functions. The way the item is rendered should be left up to the package performing the rendering.

func NewItem

func NewItem(id, name, description string, price float64) Item

NewItem creates a new Item struct.

func (*Item) Update

func (m *Item) Update(updates Item)

Jump to

Keyboard shortcuts

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