restapi

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package restapi provides shared HTTP/JSON helpers for remote ExecutionEnvironment providers (E2B, Daytona, Fly).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneLabels

func CloneLabels(in map[string]string) map[string]string

CloneLabels returns a shallow copy of a string map. Returns nil for empty input.

Types

type Client

type Client struct {
	BaseURL    string
	AuthToken  string
	HTTPClient *http.Client
}

Client is a thin HTTP/JSON helper used by remote environment providers.

func (*Client) DoJSON

func (c *Client) DoJSON(ctx context.Context, method, path string, body any, out any) error

DoJSON performs a JSON request against BaseURL+path. If body is non-nil it is marshaled as JSON. If out is non-nil the response body is decoded into it.

Jump to

Keyboard shortcuts

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