api

package
v0.3.0 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: 12 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) AddAppOwner added in v0.3.0

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

AddAppOwner grants a member access to an app ({sub, email?, name?}).

func (*Client) AddMember added in v0.3.0

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

AddMember adds an account member ({sub, email?, name?, role?}).

func (*Client) Attest added in v0.3.0

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

Attest returns the app's attestation result (server-side RA-TLS via the management service). An optional challenge nonce switches to challenge mode.

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) GetAccount added in v0.3.0

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

GetAccount returns the caller's account view ({account, role, members}).

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) ListAppOwners added in v0.3.0

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

ListAppOwners returns an app's team ({owners, creator_sub}).

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) ListMembers added in v0.3.0

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

ListMembers returns the account's members ({members, owner_sub}).

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) RemoveAppOwner added in v0.3.0

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

RemoveAppOwner revokes a member's access to an app.

func (*Client) RemoveMember added in v0.3.0

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

RemoveMember removes an account member.

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) SetMemberRole added in v0.3.0

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

SetMemberRole changes a member's account role.

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) UpdateAccount added in v0.3.0

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

UpdateAccount patches the account (name, domain, kind).

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