api

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package api is a thin typed client for the public Privasys platform API (the management service). It speaks only the documented public surface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL string
	Token   string
	HTTP    *http.Client
}

Client calls the platform API with a bearer access token.

func New

func New(baseURL, token string) *Client

New creates a client for the given API base URL and access token.

func (*Client) CheckName added in v0.2.0

func (c *Client) CheckName(ctx context.Context, name string) (map[string]interface{}, error)

CheckName reports whether an app name is available.

func (*Client) CompatibleEnclaves added in v0.2.0

func (c *Client) CompatibleEnclaves(ctx context.Context, id string) ([]map[string]interface{}, error)

CompatibleEnclaves lists enclaves an app can be deployed to.

func (*Client) CreateApp added in v0.2.0

func (c *Client) CreateApp(ctx context.Context, body map[string]interface{}) (map[string]interface{}, error)

CreateApp creates an app from the given request body (CreateAppRequest shape).

func (*Client) CreateVersion added in v0.2.0

func (c *Client) CreateVersion(ctx context.Context, id, commitURL string) (map[string]interface{}, error)

CreateVersion records a new version from a commit URL (build is triggered).

func (*Client) DeleteApp added in v0.2.0

func (c *Client) DeleteApp(ctx context.Context, id string) error

DeleteApp deletes an app by id.

func (*Client) DeployVersion added in v0.2.0

func (c *Client) DeployVersion(ctx context.Context, id, versionID, enclaveID string) (map[string]interface{}, error)

DeployVersion deploys a version to an enclave.

func (*Client) GetApp

func (c *Client) GetApp(ctx context.Context, id string) (map[string]interface{}, error)

GetApp returns a single app's full record.

func (*Client) ListApps

func (c *Client) ListApps(ctx context.Context) ([]map[string]interface{}, error)

ListApps returns the caller's apps as generic records (the CLI renders a stable subset of columns and can emit the full objects as JSON/YAML, so it does not pin the full server schema).

func (*Client) ListBuilds added in v0.2.0

func (c *Client) ListBuilds(ctx context.Context, id string) ([]map[string]interface{}, error)

ListBuilds returns an app's build jobs.

func (*Client) ListDeployments added in v0.2.0

func (c *Client) ListDeployments(ctx context.Context, id string) ([]map[string]interface{}, error)

ListDeployments returns an app's deployments.

func (*Client) ListVersions added in v0.2.0

func (c *Client) ListVersions(ctx context.Context, id string) ([]map[string]interface{}, error)

ListVersions returns an app's versions.

func (*Client) MCP added in v0.2.0

func (c *Client) MCP(ctx context.Context, id string) (map[string]interface{}, error)

MCP returns the app's MCP tool manifest.

func (*Client) RPC added in v0.2.0

func (c *Client) RPC(ctx context.Context, id, function string, body interface{}) (interface{}, error)

RPC calls an app function, passing body through verbatim and returning the raw decoded result.

func (*Client) Schema added in v0.2.0

func (c *Client) Schema(ctx context.Context, id string) (map[string]interface{}, error)

Schema returns the app's exported function schema (unwraps {status, schema}).

func (*Client) StopDeployment added in v0.2.0

func (c *Client) StopDeployment(ctx context.Context, id, deploymentID string, force bool) (map[string]interface{}, error)

StopDeployment stops a running deployment.

func (*Client) UploadCwasm added in v0.2.0

func (c *Client) UploadCwasm(ctx context.Context, id, path string) (map[string]interface{}, error)

UploadCwasm uploads a .cwasm artifact for a wasm app (multipart field "file").

Jump to

Keyboard shortcuts

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