Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ByName sorts items by name. ByName sortBy = (1 << iota) // ByDate sorts items by update date. ByDate // ByPrice sorts items by price. ByPrice )
Variables ¶
View Source
var ( // CustomPath sets a custom directory to store the inventory. CustomPath string // ReturnLocation sets the return location of the inventory (default: // returned). ReturnLocation = "returned" )
Functions ¶
Types ¶
type Item ¶
type Item struct { ID string `yaml:"id"` SKU string `yaml:"sku"` Name string `yaml:"name"` Type string `yaml:"itemtype"` Value string `yaml:"value"` Size string `yaml:"size"` Quantity string `yaml:"quantity"` Price string `yaml:"price"` Location string `yaml:"location"` Updated time.Time `yaml:"update"` }
Item is the item in the inventory.
func Add ¶
Add adds a new named item to the inventory. It will auto-generate a unique ID for the item based on the name.
func SortedItems ¶
SortedItems returns a sorted slice of items in the inventory.
func (*Item) LocationPicture ¶
LocationPicture returns the picture of the location associated with the item.
func (*Item) SetLocationPicture ¶
func (i *Item) SetLocationPicture(r io.ReadSeeker) error
SetLocationPicture sets the thumbnail picture of the item. To save space, the image is resized within 1000x1000 pixels and encoded as jpeg.
func (*Item) SetPicture ¶
func (i *Item) SetPicture(r io.ReadSeeker) error
SetPicture sets the thumbnail picture of the item. To save space, the image is resized within 1000x1000 pixels and encoded as jpeg.
Click to show internal directories.
Click to hide internal directories.