api

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create[T any](ctx context.Context, c *Client, path string, body any) (*T, error)

func Delete

func Delete(ctx context.Context, c *Client, path string) error

func Get

func Get[T any](ctx context.Context, c *Client, path string) (*T, error)

func IsNotFound

func IsNotFound(err error) bool

func List

func List[T any](ctx context.Context, c *Client, basePath string) ([]T, error)

func Patch

func Patch[T any](ctx context.Context, c *Client, path string, body any) (*T, error)

func PathEscape

func PathEscape(s string) string

func Update

func Update[T any](ctx context.Context, c *Client, path string, body any) (*T, error)

Types

type APIError

type APIError struct {
	StatusCode int
	Message    string
	Body       string
}

func (*APIError) Error

func (e *APIError) Error() string

type Client

type Client struct {
	BaseURL     string
	Token       string
	OrgID       string
	WorkspaceID string
	HTTPClient  *http.Client
	UserAgent   string
}

func NewClient

func NewClient(baseURL, token, orgID, workspaceID, version string) *Client

type SingleValueResponse

type SingleValueResponse[T any] struct {
	Data T `json:"data"`
}

Single-value response wrapper used by most endpoints.

type TableResponse

type TableResponse[T any] struct {
	Data    []T  `json:"data"`
	HasNext bool `json:"hasNext"`
}

Table response wrapper used by list endpoints.

Jump to

Keyboard shortcuts

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