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 ¶
- type BillingResult
- type Client
- func (c *Client) AddAppOwner(ctx context.Context, appID string, owner map[string]interface{}) (map[string]interface{}, error)
- func (c *Client) AddMember(ctx context.Context, member map[string]interface{}) (map[string]interface{}, error)
- func (c *Client) Attest(ctx context.Context, appID, challenge string) (map[string]interface{}, error)
- func (c *Client) BillingBalance(ctx context.Context) (*BillingResult, error)
- func (c *Client) BillingLedger(ctx context.Context, limit int) (*BillingResult, error)
- func (c *Client) BillingPortal(ctx context.Context) (string, bool, error)
- func (c *Client) BillingSubscription(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) BillingUsage(ctx context.Context, since string) (*BillingResult, error)
- func (c *Client) CheckName(ctx context.Context, name string) (map[string]interface{}, error)
- func (c *Client) Checkout(ctx context.Context, kind string) (string, bool, error)
- func (c *Client) CompatibleEnclaves(ctx context.Context, id string) ([]map[string]interface{}, error)
- func (c *Client) CreateApp(ctx context.Context, body map[string]interface{}) (map[string]interface{}, error)
- func (c *Client) CreateVersion(ctx context.Context, id, commitURL string) (map[string]interface{}, error)
- func (c *Client) DeleteApp(ctx context.Context, id string) error
- func (c *Client) DeployVersion(ctx context.Context, id, versionID, enclaveID string) (map[string]interface{}, error)
- func (c *Client) GetAccount(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) GetApp(ctx context.Context, id string) (map[string]interface{}, error)
- func (c *Client) ListAppOwners(ctx context.Context, appID string) (map[string]interface{}, error)
- func (c *Client) ListApps(ctx context.Context) ([]map[string]interface{}, error)
- func (c *Client) ListBuilds(ctx context.Context, id string) ([]map[string]interface{}, error)
- func (c *Client) ListDeployments(ctx context.Context, id string) ([]map[string]interface{}, error)
- func (c *Client) ListMembers(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) ListVersions(ctx context.Context, id string) ([]map[string]interface{}, error)
- func (c *Client) MCP(ctx context.Context, id string) (map[string]interface{}, error)
- func (c *Client) RPC(ctx context.Context, id, function string, body interface{}) (interface{}, error)
- func (c *Client) RemoveAppOwner(ctx context.Context, appID, sub string) (map[string]interface{}, error)
- func (c *Client) RemoveMember(ctx context.Context, sub string) (map[string]interface{}, error)
- func (c *Client) Schema(ctx context.Context, id string) (map[string]interface{}, error)
- func (c *Client) SetMemberRole(ctx context.Context, sub, role string) (map[string]interface{}, error)
- func (c *Client) StopDeployment(ctx context.Context, id, deploymentID string, force bool) (map[string]interface{}, error)
- func (c *Client) UpdateAccount(ctx context.Context, patch map[string]interface{}) (map[string]interface{}, error)
- func (c *Client) UploadCwasm(ctx context.Context, id, path string) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BillingResult ¶ added in v0.4.0
type BillingResult struct {
Enabled bool `json:"enabled"`
Data map[string]interface{} `json:"data"`
}
BillingResult mirrors the management-service {enabled, data?} envelope used for credit-ledger reads. When billing is not configured, Enabled is false.
type Client ¶
Client calls the platform API with a bearer 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) BillingBalance ¶ added in v0.4.0
func (c *Client) BillingBalance(ctx context.Context) (*BillingResult, error)
BillingBalance returns the account's credit balance.
func (*Client) BillingLedger ¶ added in v0.4.0
BillingLedger returns the credit-ledger history, optionally limited.
func (*Client) BillingPortal ¶ added in v0.4.0
BillingPortal returns a Stripe Customer Portal URL.
func (*Client) BillingSubscription ¶ added in v0.4.0
BillingSubscription returns the membership subscription state.
func (*Client) BillingUsage ¶ added in v0.4.0
BillingUsage returns the usage rollup, optionally since an RFC3339 time.
func (*Client) Checkout ¶ added in v0.4.0
Checkout starts a Stripe Checkout session and returns its URL. kind is "membership" or "credits".
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) 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
GetAccount returns the caller's account view ({account, role, members}).
func (*Client) ListAppOwners ¶ added in v0.3.0
ListAppOwners returns an app's team ({owners, creator_sub}).
func (*Client) ListApps ¶
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
ListBuilds returns an app's build jobs.
func (*Client) ListDeployments ¶ added in v0.2.0
ListDeployments returns an app's deployments.
func (*Client) ListMembers ¶ added in v0.3.0
ListMembers returns the account's members ({members, owner_sub}).
func (*Client) ListVersions ¶ added in v0.2.0
ListVersions returns an app's versions.
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
RemoveMember removes an account member.
func (*Client) Schema ¶ added in v0.2.0
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.