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
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)
Click to show internal directories.
Click to hide internal directories.