client

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ExitAPIError  = 1
	ExitAuthError = 2
)

Variables

View Source
var Version = "dev"

Functions

This section is empty.

Types

type APIError

type APIError struct {
	StatusCode int    `json:"status"`
	Code       int    `json:"code"`
	Message    string `json:"message"`
	Method     string `json:"method,omitempty"`
	Path       string `json:"path,omitempty"`
	RequestID  string `json:"request_id,omitempty"`
	// contains filtered or unexported fields
}

func (*APIError) Error

func (e *APIError) Error() string

func (*APIError) ExitCode

func (e *APIError) ExitCode() int

func (*APIError) Hint

func (e *APIError) Hint() string

type Client

type Client struct {
	HTTP        *http.Client
	BaseURL     string
	DataURL     string
	APIKey      string
	Secret      string
	AccessToken string
	UserAgent   string
	Verbose     bool
	Debug       bool
	Quiet       bool
	Trace       bool
	Timeout     time.Duration
}

func New

func New(cfg *config.Resolved) *Client

func (*Client) Delete

func (c *Client) Delete(path string, params url.Values) (json.RawMessage, error)

func (*Client) Get

func (c *Client) Get(path string, params url.Values) (json.RawMessage, error)

func (*Client) GetData

func (c *Client) GetData(path string, params url.Values) (json.RawMessage, error)

func (*Client) Patch

func (c *Client) Patch(path string, params url.Values, body any) (json.RawMessage, error)

func (*Client) Post

func (c *Client) Post(path string, params url.Values, body any) (json.RawMessage, error)

func (*Client) Put

func (c *Client) Put(path string, params url.Values, body any) (json.RawMessage, error)

func (*Client) RawRequest

func (c *Client) RawRequest(method, fullURL string, body any) (json.RawMessage, error)

func (*Client) SetTimeout

func (c *Client) SetTimeout(d time.Duration)

Jump to

Keyboard shortcuts

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