rest

package
v3.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *bool

func CheckResponse

func CheckResponse(rsp any) error

CheckResponse turns any non-200 response into a clear error (including the raw body).

func Float64

func Float64(v float64) *float64

func Int

func Int(v int) *int

func Int64

func Int64(v int64) *int64

func Ptr

func Ptr[T any](v T) *T

Generic Ptr (used for everything else, including custom enums)

func String

func String(v string) *string

=== Pointer helpers ===

Types

type Client

type Client struct {
	*gen.ClientWithResponses
	// contains filtered or unexported fields
}

func New

func New(apiKey string) *Client

New is backward-compatible (no options = trace=false, pagination=true)

func NewWithOptions

func NewWithOptions(apiKey string, opts ...Option) *Client

type Iterator

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

func NewIterator

func NewIterator(c *Client, firstPage []map[string]any, nextURL *string) *Iterator

func NewIteratorFromResponse

func NewIteratorFromResponse(c *Client, resp any) *Iterator

Fixed NewIteratorFromResponse — now safely handles BOTH []T and *[]T for Results

func (*Iterator) Err

func (it *Iterator) Err() error

func (*Iterator) Item

func (it *Iterator) Item() map[string]any

func (*Iterator) Next

func (it *Iterator) Next() bool

type Option

type Option func(*Client)

func WithPagination

func WithPagination(enabled bool) Option

func WithTrace

func WithTrace(enabled bool) Option

Directories

Path Synopsis
Package gen provides primitives to interact with the openapi HTTP API.
Package gen provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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