Documentation ¶
Index ¶
- type Config
- type PaymentService
- type ProductService
- func (s *ProductService) CreateOrder(ois []hashicups.OrderItem, authToken string) (*models.Order, error)
- func (s *ProductService) GetAllOrders(authToken string) ([]*models.Order, error)
- func (s *ProductService) GetCoffee(coffeeID string) (*models.Coffee, error)
- func (s *ProductService) GetCoffeeIngredients(coffeeID string) ([]*models.Ingredient, error)
- func (s *ProductService) GetCoffees() ([]*models.Coffee, error)
- func (s *ProductService) GetOrder(orderID string, authToken string) (*models.Order, error)
- func (s *ProductService) HealthCheck() bool
- func (s *ProductService) SignIn(auth models.UserAuth) (models.AuthResponse, error)
- func (s *ProductService) SignOut(authToken *string) error
- func (s *ProductService) SignUp(auth models.UserAuth) (models.AuthResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PaymentService ¶ added in v0.0.2
type PaymentService struct {
// contains filtered or unexported fields
}
PaymentService handles interactions with the payments api
func NewPaymentService ¶ added in v0.0.2
func NewPaymentService(c *payments.HTTPClient) *PaymentService
NewPaymentService returns an instance of PaymentService
func (*PaymentService) Pay ¶ added in v0.0.2
func (p *PaymentService) Pay(pd *models.PaymentDetails) (*models.PaymentResponse, error)
type ProductService ¶ added in v0.0.6
type ProductService struct {
// contains filtered or unexported fields
}
ProductService handles interaction with the product API.
func NewProductService ¶ added in v0.0.6
func NewProductService(c *hashicups.Client) *ProductService
NewProductService creates a new ProductService.
func (*ProductService) CreateOrder ¶ added in v0.0.6
func (s *ProductService) CreateOrder(ois []hashicups.OrderItem, authToken string) (*models.Order, error)
CreateOrder - Create new order
func (*ProductService) GetAllOrders ¶ added in v0.0.6
func (s *ProductService) GetAllOrders(authToken string) ([]*models.Order, error)
GetAllOrders - Get all user's order
func (*ProductService) GetCoffee ¶ added in v0.0.6
func (s *ProductService) GetCoffee(coffeeID string) (*models.Coffee, error)
GetCoffee returns a specific coffee (list).
func (*ProductService) GetCoffeeIngredients ¶ added in v0.0.6
func (s *ProductService) GetCoffeeIngredients(coffeeID string) ([]*models.Ingredient, error)
GetCoffeeIngredients - Returns list of coffee ingredients (no auth required)
func (*ProductService) GetCoffees ¶ added in v0.0.6
func (s *ProductService) GetCoffees() ([]*models.Coffee, error)
GetCoffees returns a list of coffees.
func (*ProductService) HealthCheck ¶ added in v0.0.7
func (s *ProductService) HealthCheck() bool
func (*ProductService) SignIn ¶ added in v0.0.6
func (s *ProductService) SignIn(auth models.UserAuth) (models.AuthResponse, error)
SignIn Get a new token for user.
func (*ProductService) SignOut ¶ added in v0.0.6
func (s *ProductService) SignOut(authToken *string) error
SignOut - Revoke the token for a user
func (*ProductService) SignUp ¶ added in v0.0.6
func (s *ProductService) SignUp(auth models.UserAuth) (models.AuthResponse, error)
SignUp - Create new user, return user token upon successful creation
Click to show internal directories.
Click to hide internal directories.