httpclient

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(baseURL string, c *http.Client, defaults ...ReqOpt) *Client

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, path string, opts ...ReqOpt) error

func (*Client) Get

func (c *Client) Get(ctx context.Context, path string, dest any, opts ...ReqOpt) error

func (*Client) Post

func (c *Client) Post(ctx context.Context, path string, dest any, opts ...ReqOpt) error

func (*Client) RawGet

func (c *Client) RawGet(ctx context.Context, path string, opts ...ReqOpt) (io.ReadCloser, error)

type ReqOpt

type ReqOpt func(*reqOptions) error

func WithBody

func WithBody(body io.Reader) ReqOpt

func WithHeader

func WithHeader(key, value string) ReqOpt

func WithJSONBody

func WithJSONBody(body any) ReqOpt

func WithQuery

func WithQuery(key, value string) ReqOpt

Jump to

Keyboard shortcuts

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