Documentation
¶
Index ¶
- func Decoder(res *http.Response, s interface{}) (err error)
- func Get(url string) (*http.Response, error)
- func Patch(url string, payload interface{}) (*http.Response, error)
- func Post(url string, contentType string, payload interface{}) (*http.Response, error)
- type CartAPI
- type CartAPIRef
- type CartAPISetter
- type TacoListAPI
- type TacoListAPIRef
- type TacoListAPISetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get retrieve url and return response. If Get encounters an error, it will log and return the error.
Types ¶
type CartAPI ¶
CartAPI holds API calls for Cart items
func (*CartAPI) DeleteCartItem ¶
DeleteCartItem deletes cart item
func (*CartAPI) GetCart ¶
GetCart fetches cart items and uses singleflight to avoid multiple requests. please check that top-nav.vugu and cart.vugu call GetCart and ask for the same data in their initialization. see: https://pkg.go.dev/golang.org/x/sync/singleflight
func (*CartAPI) GetCartTotal ¶
GetCartTotal calculates sum of cart items
type CartAPIRef ¶
type CartAPIRef struct {
*CartAPI
}
CartAPIRef ref for wiring
func (*CartAPIRef) CartAPISet ¶
func (r *CartAPIRef) CartAPISet(v *CartAPI)
CartAPISet setter for wiring
type CartAPISetter ¶
type CartAPISetter interface {
CartAPISet(v *CartAPI)
}
CartAPISetter interface for wiring
type TacoListAPI ¶
TacoListAPI holds API calls for Taco List
func LoadTacoListAPI ¶
func LoadTacoListAPI() *TacoListAPI
LoadTacoListAPI returns a new instance of TacoListAPI
func (*TacoListAPI) GetTacoList ¶
func (c *TacoListAPI) GetTacoList() ([]memstore.Taco, bool, error)
GetTacoList fetches taco list
type TacoListAPIRef ¶
type TacoListAPIRef struct {
*TacoListAPI
}
TacoListAPIRef ref for wiring
func (*TacoListAPIRef) TacoListAPISet ¶
func (r *TacoListAPIRef) TacoListAPISet(v *TacoListAPI)
TacoListAPISet setter for wiring
type TacoListAPISetter ¶
type TacoListAPISetter interface {
TacoListAPISet(v *TacoListAPI)
}
TacoListAPISetter interface for wiring