client

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const MassdriverBaseURL = "https://api.massdriver.cloud"

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type MassdriverClient

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

func NewClient

func NewClient() *MassdriverClient

func (*MassdriverClient) Do

func (c *MassdriverClient) Do(ctx *context.Context, req *Request) (*http.Response, error)

func (*MassdriverClient) WithAPIKey added in v0.1.0

func (c *MassdriverClient) WithAPIKey(apiKey string) *MassdriverClient

func (*MassdriverClient) WithBaseURL added in v0.3.0

func (c *MassdriverClient) WithBaseURL(endpoint string) *MassdriverClient

type Request

type Request struct {
	Method string
	Path   string
	Body   io.Reader
}

func NewRequest

func NewRequest(method string, path string, body io.Reader) *Request

func (*Request) ToHTTPRequest added in v0.1.0

func (req *Request) ToHTTPRequest(ctx context.Context, c *MassdriverClient) (*http.Request, error)

Jump to

Keyboard shortcuts

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