client

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: MIT Imports: 8 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 New

func New(URL string, httpClient *http.Client) (*Client, error)

func NewClient

func NewClient(URL string) (*Client, error)

func (*Client) Delete

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

Delete deletes the entity at the request URI.

func (*Client) Get

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

Get returns the entity at the request URI.

func (*Client) Post

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

Post updates the array at the request URI.

func (*Client) Put

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

Put replaces the entity at the request URI.

func (*Client) PutBinary

func (c *Client) PutBinary(ctx context.Context, path string, data []byte) error

PutBinary replaces the entity at the request URI with data.

type ResponseError

type ResponseError struct {
	StatusCode int
	StatusText string
	URL        string
	Text       string `json:"error,omitempty"`
	Detail     string `json:"detail,omitempty"`
}

func (*ResponseError) Error

func (e *ResponseError) Error() string

Jump to

Keyboard shortcuts

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