apiclient

package
v0.1.0-beta.9 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("resource not found")

Functions

This section is empty.

Types

type APIClient

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

APIClient handles communication with the haloy API

func New

func New(url, token string) (*APIClient, error)

func NewWithTimeout

func NewWithTimeout(url, token string, timeout time.Duration) (*APIClient, error)

func (*APIClient) Get

func (c *APIClient) Get(ctx context.Context, path string, v any) error

func (*APIClient) HealthCheck

func (c *APIClient) HealthCheck(ctx context.Context) error

func (*APIClient) Post

func (c *APIClient) Post(ctx context.Context, path string, request, response any) error

func (*APIClient) PostFile

func (c *APIClient) PostFile(ctx context.Context, path, fieldName, filePath string) error

PostFile uploads a file using multipart form data

func (*APIClient) Stream

func (c *APIClient) Stream(ctx context.Context, path string, handler func(data string) bool) error

Generic streaming method that handles any SSE endpoint

Jump to

Keyboard shortcuts

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