http

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")
View Source
var ErrUnsuccessfulResponse = errors.New("API returned an unsuccessful response. Check the API logs for more details")

Functions

This section is empty.

Types

type Client

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

func New

func New(baseUrl string, authenticator auth.Authenticator, options *Options) *Client

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, path string, response interface{}) error

func (*Client) Get

func (c *Client) Get(ctx context.Context, path string, response interface{}) error

func (*Client) Post

func (c *Client) Post(ctx context.Context, path string, request interface{}, response interface{}) error

func (*Client) Put

func (c *Client) Put(ctx context.Context, path string, request interface{}, response interface{}) error

type Options

type Options struct {
	Timeout           time.Duration
	AdditionalHeaders map[string]string
}

type SuccessResponse

type SuccessResponse struct {
	Success bool `json:"success"`
}

Jump to

Keyboard shortcuts

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