client

package
Version: v0.0.0-...-6bf1803 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor interface {
	PerformActionLoop(prodID, quantity uint) error
}

type Client

type Client interface {
	Login() error
	AddToCart(prodID, quantity uint) error
	Checkout() error
}

type ErrorBody

type ErrorBody struct {
	Error string `json:"error"`
	Code  int    `json:"code"`
}

type Product

type Product struct {
	ID       uint `json:"id"`
	Quantity uint `json:"quantity"`
}

type ShopClient

type ShopClient struct {
	Name string
	// contains filtered or unexported fields
}

func New

func New(username, password, shopAPI string) (*ShopClient, error)

func (*ShopClient) AddToCart

func (s *ShopClient) AddToCart(prodID, qunatity uint) error

AddToCart adds a product to the client cart

func (*ShopClient) Checkout

func (s *ShopClient) Checkout() error

func (*ShopClient) Login

func (s *ShopClient) Login() error

func (*ShopClient) PerformActionLoop

func (s *ShopClient) PerformActionLoop(itemsToBuy map[uint]uint) error

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL