services

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrItemExists = errors.New("item already exists")
View Source
var ErrItemNotFound = errors.New("item not found")
View Source
var ErrLocationExists = errors.New("location already exists")

ErrLocationExists is returned when a location already exists

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

ErrLocationNotFound is returned when a location is not found

Functions

This section is empty.

Types

type ItemService

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

func NewItemService

func NewItemService(store *storage.Store) ItemService

func (ItemService) AddItem

func (s ItemService) AddItem(item models.Item) error

func (ItemService) GetItem

func (s ItemService) GetItem(itemID string) (models.Item, error)

func (ItemService) GetItems

func (s ItemService) GetItems() ([]models.Item, error)

type LocationService

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

func NewLocationService

func NewLocationService(store storage.LocationStore) LocationService

func (LocationService) AddLocation

func (s LocationService) AddLocation(loc models.Location) error

AddLocation adds a new location to the store

Returns ErrLocationExists if the location already exists

Returns an error if the store fails to add the location

func (LocationService) GetLocation

func (s LocationService) GetLocation(locationID string) (models.Location, error)

GetLocation returns a location from the store

Returns ErrLocationNotFound if the location is not found

Returns an error if the store fails to get the location

func (LocationService) GetLocations

func (s LocationService) GetLocations() ([]models.Location, error)

Jump to

Keyboard shortcuts

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