Documentation
¶
Index ¶
- Constants
- func GetOrder(name string, db cache.Getter) (*dawg.Order, error)
- func ListOrders(db cache.MapDB) []string
- func OpenDatabase() (*cache.DataBase, error)
- func PrintOrders(db cache.MapDB, w io.Writer, verbose bool, color string) error
- func SaveOrder(o *dawg.Order, w io.Writer, db cache.Putter) error
- type Decoder
- type Encoder
- type MenuCacher
Constants ¶
View Source
const ( // OrderPrefix is the prefix added to user orders when stored in a database. OrderPrefix = "user_order_" // DataBaseName is the filename for the program's local storage. DataBaseName = "apizza.db" )
Variables ¶
This section is empty.
Functions ¶
func ListOrders ¶ added in v0.0.3
ListOrders will return a list of orders stored in the database.
func OpenDatabase ¶ added in v0.0.3
OpenDatabase make the default database.
func PrintOrders ¶
PrintOrders will print all the names of the saved user orders
Types ¶
type Decoder ¶ added in v0.0.3
type Decoder interface {
Decode(interface{}) error
}
Decoder is an interface that defines objects that can decode and interface.
type Encoder ¶ added in v0.0.3
type Encoder interface {
Encode(interface{}) error
}
Encoder is an interface that defines objects that are able to Encode and interface.
type MenuCacher ¶
MenuCacher defines an interface that retrieves, caches, and stores menu timestamps.
func NewGobMenuCacher ¶ added in v0.0.3
func NewGobMenuCacher( decay time.Duration, db cache.Storage, store func() *dawg.Store, ) MenuCacher
NewGobMenuCacher will create a MenuCacher that will store the menu in a binary format using the "encoding/gob" package.
func NewJSONMenuCacher ¶ added in v0.0.3
func NewJSONMenuCacher( decay time.Duration, db cache.Storage, store func() *dawg.Store, ) MenuCacher
NewJSONMenuCacher will create a new MenuCacher that stores the menu as json.
func NewMenuCacher ¶
NewMenuCacher creates a new MenuCacher.
Click to show internal directories.
Click to hide internal directories.