models

package
v0.0.0-...-f3973e5 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLocationIDEmpty = errors.New("location id cannot be empty")
View Source
var ErrLocationIDTooLong = errors.New("location id cannot be longer than 10 characters")
View Source
var ErrLocationNameEmpty = errors.New("location name cannot be empty")
View Source
var ErrLocationNameTooLong = errors.New("location name cannot be longer than 24 characters")

Functions

func NewShortID

func NewShortID(value string) string

Types

type Item

type Item struct {
	ID         string
	Name       string
	Quantity   int8
	LocationID string
}

func NewItem

func NewItem(name string) Item

func NewItemWithID

func NewItemWithID(id, name string) Item

func (Item) Validate

func (i Item) Validate() error

type Location

type Location struct {
	ID   string
	Name string
}

func NewLocation

func NewLocation(name string) Location

func NewLocationWithID

func NewLocationWithID(id, name string) Location

func (Location) Validate

func (l Location) Validate() error

Jump to

Keyboard shortcuts

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