Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Menu = []*tospb.Category{ { Name: "Sandwiches", Items: []*tospb.Item{ {Name: "LG Smoked Pulled Pork", Price: 495, Options: []*tospb.Option{ {Name: "pickles", Price: 0, Selected: true}, {Name: "bbq sauce", Price: 0, Selected: true}, {Name: "white sauce", Price: 0, Selected: false}, {Name: "ketchup", Price: 0, Selected: false}, {Name: "mayo", Price: 0, Selected: false}, {Name: "coleslaw", Price: 25, Selected: false}, {Name: "tomato", Price: 25, Selected: false}, {Name: "lettuce", Price: 25, Selected: false}, {Name: "cheese", Price: 25, Selected: false}, {Name: "onion", Price: 25, Selected: false}, }}, {Name: "RG Smoked Pulled Pork", Price: 395, Options: []*tospb.Option{ {Name: "pickles", Price: 0, Selected: true}, {Name: "bbq sauce", Price: 0, Selected: true}, {Name: "white sauce", Price: 0, Selected: false}, {Name: "ketchup", Price: 0, Selected: false}, {Name: "mayo", Price: 0, Selected: false}, {Name: "coleslaw", Price: 25, Selected: false}, {Name: "tomato", Price: 25, Selected: false}, {Name: "lettuce", Price: 25, Selected: false}, {Name: "cheese", Price: 25, Selected: false}, {Name: "onion", Price: 25, Selected: false}, }}, {Name: "LG Smoked Chicken Breast", Price: 495, Options: []*tospb.Option{ {Name: "pickles", Price: 0, Selected: false}, {Name: "bbq sauce", Price: 0, Selected: false}, {Name: "white sauce", Price: 0, Selected: false}, {Name: "ketchup", Price: 0, Selected: false}, {Name: "mayo", Price: 0, Selected: true}, {Name: "coleslaw", Price: 25, Selected: false}, {Name: "tomato", Price: 25, Selected: true}, {Name: "lettuce", Price: 25, Selected: true}, {Name: "cheese", Price: 25, Selected: false}, {Name: "onion", Price: 25, Selected: false}, }}, {Name: "RG Smoked Chicken Breast", Price: 395, Options: []*tospb.Option{ {Name: "pickles", Price: 0, Selected: false}, {Name: "bbq sauce", Price: 0, Selected: false}, {Name: "white sauce", Price: 0, Selected: false}, {Name: "ketchup", Price: 0, Selected: true}, {Name: "mayo", Price: 0, Selected: true}, {Name: "coleslaw", Price: 25, Selected: false}, {Name: "tomato", Price: 25, Selected: true}, {Name: "lettuce", Price: 25, Selected: true}, {Name: "cheese", Price: 25, Selected: false}, {Name: "onion", Price: 25, Selected: false}, }}, {Name: "'The Molly'", Price: 395, Options: []*tospb.Option{ {Name: "pickles", Price: 0, Selected: true}, {Name: "bbq sauce", Price: 0, Selected: true}, {Name: "white sauce", Price: 0, Selected: true}, {Name: "ketchup", Price: 0, Selected: false}, {Name: "mayo", Price: 0, Selected: false}, {Name: "coleslaw", Price: 25, Selected: true}, {Name: "tomato", Price: 25, Selected: false}, {Name: "lettuce", Price: 25, Selected: false}, {Name: "cheese", Price: 25, Selected: false}, {Name: "onion", Price: 25, Selected: false}, }}, {Name: "LG Hamburger", Price: 495, Options: []*tospb.Option{ {Name: "pickles", Price: 0, Selected: true}, {Name: "bbq sauce", Price: 0, Selected: true}, {Name: "white sauce", Price: 0, Selected: false}, {Name: "ketchup", Price: 0, Selected: false}, {Name: "mayo", Price: 0, Selected: false}, {Name: "coleslaw", Price: 25, Selected: false}, {Name: "tomato", Price: 25, Selected: false}, {Name: "lettuce", Price: 25, Selected: false}, }}, {Name: "Hamburger", Price: 395, Options: []*tospb.Option{ {Name: "pickles", Price: 0, Selected: true}, {Name: "bbq sauce", Price: 0, Selected: true}, {Name: "white sauce", Price: 0, Selected: false}, {Name: "ketchup", Price: 0, Selected: false}, {Name: "mayo", Price: 0, Selected: false}, {Name: "coleslaw", Price: 25, Selected: false}, {Name: "tomato", Price: 25, Selected: false}, {Name: "lettuce", Price: 25, Selected: false}, }}, {Name: "LG Cheeseburger", Price: 550, Options: []*tospb.Option{ {Name: "pickles", Price: 0, Selected: true}, {Name: "bbq sauce", Price: 0, Selected: true}, {Name: "white sauce", Price: 0, Selected: false}, {Name: "ketchup", Price: 0, Selected: false}, {Name: "mayo", Price: 0, Selected: false}, {Name: "coleslaw", Price: 25, Selected: false}, {Name: "tomato", Price: 25, Selected: false}, {Name: "lettuce", Price: 25, Selected: false}, }}, {Name: "Cheeseburger", Price: 425, Options: []*tospb.Option{ {Name: "pickles", Price: 0, Selected: true}, {Name: "bbq sauce", Price: 0, Selected: true}, {Name: "white sauce", Price: 0, Selected: false}, {Name: "ketchup", Price: 0, Selected: false}, {Name: "mayo", Price: 0, Selected: false}, {Name: "coleslaw", Price: 25, Selected: false}, {Name: "tomato", Price: 25, Selected: false}, {Name: "lettuce", Price: 25, Selected: false}, }}, {Name: "Grilled Cheese", Price: 300, Options: []*tospb.Option{ {Name: "pickles", Price: 0, Selected: true}, {Name: "bbq sauce", Price: 0, Selected: true}, {Name: "white sauce", Price: 0, Selected: false}, {Name: "ketchup", Price: 0, Selected: false}, {Name: "mayo", Price: 0, Selected: false}, {Name: "coleslaw", Price: 25, Selected: false}, {Name: "tomato", Price: 25, Selected: false}, {Name: "lettuce", Price: 25, Selected: false}, }}, {Name: "Pulled Pork Melt", Price: 395, Options: []*tospb.Option{ {Name: "pickles", Price: 0, Selected: true}, {Name: "bbq sauce", Price: 0, Selected: true}, {Name: "white sauce", Price: 0, Selected: false}, {Name: "ketchup", Price: 0, Selected: false}, {Name: "mayo", Price: 0, Selected: false}, {Name: "coleslaw", Price: 25, Selected: false}, {Name: "tomato", Price: 25, Selected: false}, {Name: "lettuce", Price: 25, Selected: false}, }}, }, }, { Name: "Plates", Items: []*tospb.Item{ {Name: "Smoked Pulled Pork", Price: 990, Options: []*tospb.Option{ {Name: "potato salad", Price: 0, Selected: false}, {Name: "baked beans", Price: 0, Selected: false}, {Name: "coleslaw", Price: 0, Selected: false}, {Name: "chips", Price: 0, Selected: false}, {Name: "fries", Price: 0, Selected: false}, {Name: "baked potato", Price: 100, Selected: false}, }}, {Name: "RG Rib", Price: 995, Options: []*tospb.Option{ {Name: "potato salad", Price: 0, Selected: false}, {Name: "baked beans", Price: 0, Selected: false}, {Name: "coleslaw", Price: 0, Selected: false}, {Name: "chips", Price: 0, Selected: false}, {Name: "fries", Price: 0, Selected: false}, {Name: "baked potato", Price: 100, Selected: false}, }}, {Name: "½ Smoked Chicken", Price: 995, Options: []*tospb.Option{ {Name: "potato salad", Price: 0, Selected: false}, {Name: "baked beans", Price: 0, Selected: false}, {Name: "coleslaw", Price: 0, Selected: false}, {Name: "chips", Price: 0, Selected: false}, {Name: "fries", Price: 0, Selected: false}, {Name: "baked potato", Price: 100, Selected: false}, }}, {Name: "Smoked Chicken Breast", Price: 725, Options: []*tospb.Option{ {Name: "potato salad", Price: 0, Selected: false}, {Name: "baked beans", Price: 0, Selected: false}, {Name: "coleslaw", Price: 0, Selected: false}, {Name: "chips", Price: 0, Selected: false}, {Name: "fries", Price: 0, Selected: false}, {Name: "baked potato", Price: 100, Selected: false}, }}, {Name: "Smoked Wing (8 wings)", Price: 999, Options: []*tospb.Option{ {Name: "potato salad", Price: 0, Selected: false}, {Name: "baked beans", Price: 0, Selected: false}, {Name: "coleslaw", Price: 0, Selected: false}, {Name: "chips", Price: 0, Selected: false}, {Name: "fries", Price: 0, Selected: false}, {Name: "baked potato", Price: 100, Selected: false}, }}, {Name: "BBQ Loaded Nachos", Price: 875, Options: []*tospb.Option{ {Name: "cheddar cheese", Price: 0, Selected: true}, {Name: "green onions", Price: 0, Selected: true}, {Name: "jalapeños", Price: 0, Selected: true}, {Name: "bbq sauce", Price: 0, Selected: false}, {Name: "white sauce", Price: 0, Selected: false}, }}, {Name: "Chicken Loaded Nachos", Price: 875, Options: []*tospb.Option{ {Name: "cheddar cheese", Price: 0, Selected: true}, {Name: "green onions", Price: 0, Selected: true}, {Name: "jalapeños", Price: 0, Selected: true}, {Name: "bbq sauce", Price: 0, Selected: false}, {Name: "white sauce", Price: 0, Selected: false}, }}, }, }, { Name: "Baskets", Items: []*tospb.Item{ {Name: "Smoked Wing", Price: 500, Options: []*tospb.Option{ {Name: "potato salad", Price: 0, Selected: false}, {Name: "baked beans", Price: 0, Selected: false}, {Name: "coleslaw", Price: 0, Selected: false}, {Name: "chips", Price: 0, Selected: false}, {Name: "fries", Price: 0, Selected: false}, {Name: "baked potato", Price: 100, Selected: false}, }}, {Name: "Rib", Price: 500, Options: []*tospb.Option{ {Name: "potato salad", Price: 0, Selected: false}, {Name: "baked beans", Price: 0, Selected: false}, {Name: "coleslaw", Price: 0, Selected: false}, {Name: "chips", Price: 0, Selected: false}, {Name: "fries", Price: 0, Selected: false}, {Name: "baked potato", Price: 100, Selected: false}, }}, }, }, { Name: "Potatoes", Items: []*tospb.Item{ {Name: "Loaded Pork", Price: 899, Options: []*tospb.Option{ {Name: "cheese", Price: 0, Selected: true}, {Name: "bacon bits", Price: 0, Selected: true}, {Name: "green onions", Price: 0, Selected: true}, {Name: "butter", Price: 0, Selected: true}, {Name: "sour cream", Price: 0, Selected: true}, }}, {Name: "Loaded Chicken", Price: 899, Options: []*tospb.Option{ {Name: "cheese", Price: 0, Selected: true}, {Name: "bacon bits", Price: 0, Selected: true}, {Name: "green onions", Price: 0, Selected: true}, {Name: "butter", Price: 0, Selected: true}, {Name: "sour cream", Price: 0, Selected: true}, }}, {Name: "Loaded Potato (no meat)", Price: 699, Options: []*tospb.Option{ {Name: "cheese", Price: 0, Selected: true}, {Name: "bacon bits", Price: 0, Selected: true}, {Name: "green onions", Price: 0, Selected: true}, {Name: "butter", Price: 0, Selected: true}, {Name: "sour cream", Price: 0, Selected: true}, }}, {Name: "(Pork) Smothered and Covered Fries", Price: 899, Options: []*tospb.Option{ {Name: "cheese", Price: 0, Selected: true}, {Name: "bacon bits", Price: 0, Selected: true}, {Name: "green onions", Price: 0, Selected: true}, {Name: "butter", Price: 0, Selected: true}, {Name: "sour cream", Price: 0, Selected: true}, }}, {Name: "(Chicken) Smothered and Covered Fries", Price: 899, Options: []*tospb.Option{ {Name: "cheese", Price: 0, Selected: true}, {Name: "bacon bits", Price: 0, Selected: true}, {Name: "green onions", Price: 0, Selected: true}, {Name: "butter", Price: 0, Selected: true}, {Name: "sour cream", Price: 0, Selected: true}, }}, }, }, { Name: "Sides", Items: []*tospb.Item{ {Name: "SM Cole Slaw", Price: 300}, {Name: "LG Cole Slaw", Price: 600}, {Name: "SM Baked Beans", Price: 300}, {Name: "LG Baked Beans", Price: 600}, {Name: "SM Potato Salad", Price: 300}, {Name: "LG Potato Salad", Price: 600}, {Name: "Plain Chips", Price: 100}, {Name: "Fries", Price: 300}, }, }, { Name: "Drinks", Items: []*tospb.Item{ {Name: "Canned Drink", Price: 100}, {Name: "Bottled Water", Price: 150}, }, }, { Name: "Desserts", Items: []*tospb.Item{ {Name: "Oreo Dream", Price: 350}, {Name: "Lemon Delight", Price: 350}, {Name: "Strawberry Pizza", Price: 350}, {Name: "Whole Dessert", Price: 3000}, {Name: "SM Banana Pudding", Price: 350}, {Name: "LG Banana Pudding", Price: 700}, }, }, { Name: "Sauces", Items: []*tospb.Item{ {Name: "Extra Ranch", Price: 50}, {Name: "Extra White", Price: 50}, {Name: "Extra Buffalo Wing", Price: 50}, {Name: "Extra BBQ", Price: 50}, }, }, }
Menu is a struct used for seeding the database
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config is used for determing use of which services and db
func WithMenu ¶
func WithMenu() Config
WithMenu is used for calling NewMenuService with a specific db
func WithOrder ¶
func WithOrder() Config
WithOrder is used for calling NewOrderService with a specific db
func WithSqlite ¶
WithSqlite takes in a path and opens the database
type MenuDB ¶
type MenuDB interface { SeedMenu() error CreateMenuItem(*tospb.Item) (int64, error) DeleteMenuItem(int64) error UpdateMenuItem(*tospb.Item) error // CreateMenuItemOption() error GetMenu() (*tospb.Menu, error) }
MenuDB is everything that interacts with the database involving the menu
type MenuService ¶
type MenuService interface { MenuDB }
MenuService the the abstraction for the MenuDB
func NewMenuService ¶
func NewMenuService(db *sqlx.DB) (MenuService, error)
NewMenuService creates a menu service for interacting with the database
type OrderDB ¶
type OrderDB interface { GetOrders() ([]*tospb.Order, error) CompleteOrder(id int64) error SubmitOrder(o *tospb.Order) error }
OrderDB is everything that interacts with the database involving the orders
type OrderService ¶
type OrderService interface { OrderDB }
OrderService is the abstraction of the db layer
func NewOrderService ¶
func NewOrderService(db *sqlx.DB) (OrderService, error)
NewOrderService creates a new order service for interacting with the database
type Services ¶
type Services struct { Order OrderService Menu MenuService // contains filtered or unexported fields }
Services is the implementation of both the Menu and Order service for interacting with the database as well as the databse itself
func NewServices ¶
NewServices creates a Service struct with all of the ServiceConfigs passed into it