api

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RetryAttemps        = 3
	RetryWaitSeconds    = 5
	RetryMaxWaitSeconds = 20
)

Variables

View Source
var ErrNoPointer = fmt.Errorf("target interface must be a pointer")

Functions

This section is empty.

Types

type AuthenticationRequestPayload

type AuthenticationRequestPayload struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type AuthenticationType added in v0.1.0

type AuthenticationType int
const (
	Customer AuthenticationType = iota
	Administrator
)

func (AuthenticationType) Route added in v0.1.0

func (authenticationType AuthenticationType) Route() string

type Client

type Client struct {
	HTTPClient *resty.Client
}

func NewAPIClientFromAuthentication added in v0.1.0

func NewAPIClientFromAuthentication(storeConfig *StoreConfig, payload AuthenticationRequestPayload, authenticationType AuthenticationType) (*Client, error)

func NewAPIClientFromIntegration added in v0.1.0

func NewAPIClientFromIntegration(storeConfig *StoreConfig, bearer string) (*Client, error)

func NewAPIClientWithoutAuthentication added in v0.1.0

func NewAPIClientWithoutAuthentication(storeConfig *StoreConfig) *Client

func (*Client) GetRouteAndDecode added in v0.1.0

func (c *Client) GetRouteAndDecode(route string, target interface{}, tryTo string) error

func (*Client) PostRouteAndDecode added in v0.1.0

func (c *Client) PostRouteAndDecode(route string, body, target interface{}, tryTo string) error

type StoreConfig

type StoreConfig struct {
	Scheme    string
	HostName  string
	StoreCode string
}

Jump to

Keyboard shortcuts

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