api

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckResponse

func CheckResponse(resp *http.Response, body []byte) error

CheckResponse returns nil for 2xx responses or an *APIError describing the failure for non-2xx responses.

Types

type APIError

type APIError struct {
	StatusCode int
	Code       string
	Message    string
	Cause      string
	Remedy     string
	TraceID    string
}

APIError is the structured representation of a non-2xx Oodle API response.

func (*APIError) Error

func (e *APIError) Error() string

Error implements the error interface.

type Client

type Client struct {
	// Inner is exported so command files can call generated methods directly.
	Inner  *client.ClientWithResponses
	Config *config.Config
}

Client wraps the generated OpenAPI client and adds Oodle-specific behaviour: API-key injection, retries on transient failures, and friendly error formatting.

func NewClient

func NewClient(cfg *config.Config, maxRetries int) (*Client, error)

NewClient constructs a Client for the given config.

Jump to

Keyboard shortcuts

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