client

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

Types

type APIError

type APIError struct {
	StatusCode int
	Response   *ErrorResponse
}

func (*APIError) Error

func (e *APIError) Error() string

type ClientConfig

type ClientConfig struct {
	BaseURL    string
	HTTPClient *http.Client
	Logger     zerolog.Logger
}

type ErrorResponse

type ErrorResponse struct {
	Error   string `json:"error"`
	Message string `json:"message"`
	Details string `json:"details"`
}

func (*ErrorResponse) String

func (e *ErrorResponse) String() string

type RestClient added in v0.0.6

type RestClient struct {
	Config ClientConfig
}

func NewRestClient added in v0.0.6

func NewRestClient(config ClientConfig) (*RestClient, error)

func (*RestClient) DoRequest added in v0.0.6

func (c *RestClient) DoRequest(ctx context.Context, method, path string, body any) (*http.Response, error)

func (*RestClient) HandleResponse added in v0.0.6

func (c *RestClient) HandleResponse(resp *http.Response, result any) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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