rest

package
v0.0.0-...-99c94e3 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version       = "1.0.0"
	UserAgent     = "WooCommerce API Client/" + Version
	HashAlgorithm = "HMAC-SHA256"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiConfig

type ApiConfig struct {
	API             bool
	APIPrefix       string
	Version         string
	Timeout         time.Duration
	VerifySSL       bool
	QueryStringAuth string
	OauthTimestamp  time.Time
	ConsumerKey     string
	ConsumerSecret  string
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

Http client

func NewClient

func NewClient(store string, apiConfig *ApiConfig) (*Client, error)

NewClient creates a new httpClient for the given apiConfig.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, endpoint string, params url.Values) (io.ReadCloser, error)

func (*Client) Get

func (c *Client) Get(ctx context.Context, endpoint string, params url.Values, result interface{}) error

func (*Client) Options

func (c *Client) Options(ctx context.Context, endpoint string) (io.ReadCloser, error)

func (*Client) Post

func (c *Client) Post(ctx context.Context, endpoint string, data interface{}) (io.ReadCloser, error)

func (*Client) Put

func (c *Client) Put(ctx context.Context, endpoint string, data interface{}) (io.ReadCloser, error)

type Interface

type Interface interface {
	//Post() *Client
	//Put() *Client
	//	Patch() *Client
	Get(ctx context.Context, endpoint string, params url.Values, result interface{}) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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