internal

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPI

func NewAPI(client *HttpClient, logger Log) *api

func ToString

func ToString(o interface{}) string

Types

type Error

type Error struct {
	Type        *string `json:"type,omitempty"`
	Description *string `json:"description,omitempty"`
	Status      *string `json:"status,omitempty"`
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) StatusCode

func (e *Error) StatusCode() string

func (Error) String

func (o Error) String() string

type HTTPError

type HTTPError struct {
	Name       string
	StatusCode int
	Body       []byte
}

func (*HTTPError) Error

func (h *HTTPError) Error() string

type HttpClient

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

func NewHttpClient

func NewHttpClient(client *http.Client, baseUrl string) (*HttpClient, error)

func (*HttpClient) Delete

func (c *HttpClient) Delete(ctx context.Context, name, path string, responseBody interface{}) error

func (*HttpClient) DeleteWithQuery added in v0.1.11

func (c *HttpClient) DeleteWithQuery(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error

func (*HttpClient) Get

func (c *HttpClient) Get(ctx context.Context, name, path string, responseBody interface{}) error

func (*HttpClient) GetWithQuery

func (c *HttpClient) GetWithQuery(ctx context.Context, name, path string, query url.Values, responseBody interface{}) error

func (*HttpClient) Post

func (c *HttpClient) Post(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error

func (*HttpClient) Put

func (c *HttpClient) Put(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error

type Log

type Log interface {
	Println(v ...interface{})
}

Jump to

Keyboard shortcuts

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