Versions in this module Expand all Collapse all v0 v0.1.0 Oct 16, 2026 Changes in this version + const DefaultBaseURL + const DefaultMaxAttempts + const DefaultTimeout + func IsCode(err error, code ErrorCode) bool + type APIToken struct + AllowedActions []Action + ContainerID string + CreatedAt time.Time + CreatedByUserID string + FirewallID string + ID string + KeyIDs []string + Name string + RevokedAt *time.Time + type Action string + const ActionCreate + const ActionDecrypt + const ActionDelete + const ActionEncrypt + const ActionRead + const ActionRename + const ActionRestore + const ActionRewrap + const ActionRotate + const ActionUnwrap + const ActionWrap + type AuditEvent struct + APITokenID string + Bytes *int64 + ErrorCode ErrorCode + ID int64 + KMSMicros *int64 + KMSVersion string + KeyID string + Op AuditOp + RequestID string + Result AuditResult + SourceIP string + Time time.Time + UserID string + type AuditEventsParams struct + Limit int + Since time.Time + Until time.Time + type AuditOp string + const OpCreateAPIToken + const OpCreateContainer + const OpCreateFirewall + const OpCreateKey + const OpDecrypt + const OpDeleteContainer + const OpDeleteFirewall + const OpDeleteKey + const OpDestroyKey + const OpDestroyVersion + const OpEncrypt + const OpRenameContainer + const OpRenameKey + const OpRestoreKey + const OpRevokeAPIToken + const OpRewrap + const OpRotate + const OpUnwrap + const OpUpdateAPIToken + const OpUpdateFirewall + const OpWrap + type AuditResult string + const ResultError + const ResultOK + type Billing struct + CancelAt *time.Time + Estimate BillingEstimate + Period string + Status BillingStatus + type BillingEstimate struct + Currency string + Lines []BillingLine + TotalCents int64 + type BillingLine struct + AmountCents int64 + DaysInPeriod int64 + FeeAmountCents int64 + FeeCents int64 + KeyDays int64 + KeyMonths int64 + OverageAmountCents int64 + OverageMillicentsPerOp int64 + OverageOps int64 + Tier Tier + type BillingSession struct + URL string + type BillingStatus string + const BillingActive + const BillingLapsed + const BillingNone + const BillingPastDue + const BillingUnpaid + type ChainHead struct + Hash string + Seq int64 + type Client struct + func NewClient(token string, opts ...Option) (*Client, error) + func (c *Client) Billing(ctx context.Context) (*Billing, error) + func (c *Client) CreateAPIToken(ctx context.Context, params *CreateAPITokenParams) (*CreatedAPIToken, error) + func (c *Client) CreateCheckoutSession(ctx context.Context) (*BillingSession, error) + func (c *Client) CreateContainer(ctx context.Context, name string) (*Container, error) + func (c *Client) CreateFirewall(ctx context.Context, params *CreateFirewallParams) (*Firewall, error) + func (c *Client) CreateKey(ctx context.Context, params *CreateKeyParams) (*Key, error) + func (c *Client) CreatePortalSession(ctx context.Context) (*BillingSession, error) + func (c *Client) Decrypt(ctx context.Context, keyID string, ciphertext, aad []byte) ([]byte, error) + func (c *Client) DeleteContainer(ctx context.Context, containerID string) error + func (c *Client) DeleteFirewall(ctx context.Context, firewallID string) error + func (c *Client) DeleteKey(ctx context.Context, keyID string) (*Key, error) + func (c *Client) DestroyKey(ctx context.Context, keyID string) error + func (c *Client) Encrypt(ctx context.Context, keyID string, plaintext, aad []byte) ([]byte, error) + func (c *Client) GenerateDataKey(ctx context.Context, keyID string, aad []byte) (*DataKey, error) + func (c *Client) GetKey(ctx context.Context, keyID string) (*Key, error) + func (c *Client) Health(ctx context.Context) error + func (c *Client) ListAPITokens(ctx context.Context) ([]APIToken, error) + func (c *Client) ListAuditEvents(ctx context.Context, keyID string, params *AuditEventsParams) ([]AuditEvent, error) + func (c *Client) ListContainers(ctx context.Context) ([]Container, error) + func (c *Client) ListFirewalls(ctx context.Context) ([]Firewall, error) + func (c *Client) ListKeys(ctx context.Context) ([]Key, error) + func (c *Client) Me(ctx context.Context) (*Me, error) + func (c *Client) PermissionChain(ctx context.Context, containerID string) (*PermissionChain, error) + func (c *Client) RenameContainer(ctx context.Context, containerID, name string) (*Container, error) + func (c *Client) RenameKey(ctx context.Context, keyID, name string) (*Key, error) + func (c *Client) RestoreKey(ctx context.Context, keyID string) (*Key, error) + func (c *Client) RevokeAPIToken(ctx context.Context, tokenID string) error + func (c *Client) Rewrap(ctx context.Context, keyID string, ciphertext, aad []byte) ([]byte, error) + func (c *Client) RotateKey(ctx context.Context, keyID string) (*Key, error) + func (c *Client) Unwrap(ctx context.Context, keyID string, wrapped, aad []byte) ([]byte, error) + func (c *Client) UpdateAPIToken(ctx context.Context, tokenID string, params *UpdateAPITokenParams) (*UpdatedAPIToken, error) + func (c *Client) UpdateFirewall(ctx context.Context, firewallID string, params *UpdateFirewallParams) (*Firewall, error) + func (c *Client) Usage(ctx context.Context, period string) ([]UsageLine, error) + func (c *Client) Wrap(ctx context.Context, keyID string, dek, aad []byte) ([]byte, error) + type Container struct + CreatedAt time.Time + ID string + IsDefault bool + Name string + type CreateAPITokenParams struct + AllowedActions []Action + ContainerID string + Name string + type CreateFirewallParams struct + AllowedIPs []string + ContainerID string + Name string + type CreateKeyParams struct + ContainerID string + Name string + Tier Tier + type CreatedAPIToken struct + AllowedActions []Action + ContainerID string + CreatedAt time.Time + ID string + Name string + PermissionChainHead ChainHead + Prefix string + Token string + type DataKey struct + Plaintext []byte + Wrapped []byte + type Error struct + Attempts int + Cap int64 + Code ErrorCode + Err error + Kind ErrorKind + Message string + RequestID string + ResetsAt time.Time + StatusCode int + func (e *Error) Error() string + func (e *Error) Unwrap() error + type ErrorCode string + const CodeAPITokenRequired + const CodeActionNotAllowed + const CodeBillingActive + const CodeBillingNotSetUp + const CodeBillingRequired + const CodeContainerExists + const CodeContainerIsDefault + const CodeContainerNotEmpty + const CodeFirewallExists + const CodeFirewallInUse + const CodeFreeKeyExists + const CodeIPNotAllowed + const CodeInternalError + const CodeInvalidAllowedActions + const CodeInvalidAllowedIPs + const CodeInvalidBase64 + const CodeInvalidCiphertext + const CodeInvalidContainer + const CodeInvalidDEKLength + const CodeInvalidFirewall + const CodeInvalidKeyIDs + const CodeInvalidName + const CodeInvalidPeriod + const CodeInvalidQuery + const CodeInvalidRequest + const CodeInvalidTier + const CodeKeyExists + const CodeKeyNotAllowed + const CodeKeyPendingDeletion + const CodeMethodNotAllowed + const CodeNoTenant + const CodeNotFound + const CodeNotPendingDeletion + const CodeOpsCapReached + const CodePayloadTooLarge + const CodeRateLimited + const CodeRestoreWindowClosed + const CodeSessionRequired + const CodeTooManyRetiringVersions + const CodeUnauthorized + const CodeUnavailable + const CodeUnsupportedMediaType + type ErrorKind int + const KindAPI + const KindResponse + const KindTransport + func (k ErrorKind) String() string + type Firewall struct + AllowedIPs []string + ContainerID string + CreatedAt time.Time + ID string + Name string + type Key struct + ContainerID string + CreatedAt time.Time + DeleteRequestedAt *time.Time + DestroyAfter *time.Time + ID string + Name string + PrimaryVersion string + RetiringVersions []RetiringVersion + State KeyState + Tier Tier + Versions []string + type KeyState string + const KeyActive + const KeyPendingDeletion + type Me struct + Role Role + Tenant Tenant + User User + type Option func(*options) + func WithBackoff(backoff func(retry int) time.Duration) Option + func WithBaseURL(baseURL string) Option + func WithHTTPClient(client *http.Client) Option + func WithMaxAttempts(n int) Option + func WithUserAgent(userAgent string) Option + type Patch struct + func Clear[T any]() Patch[T] + func Set[T any](v T) Patch[T] + func (p Patch[T]) IsClear() bool + func (p Patch[T]) IsZero() bool + func (p Patch[T]) MarshalJSON() ([]byte, error) + func (p Patch[T]) Value() (T, bool) + type PermissionChain struct + ContainerID string + Head ChainHead + type RetiringVersion struct + DestroyAfter time.Time + Version string + type Role string + const RoleAdmin + const RoleMember + const RoleOwner + type Tenant struct + ID string + Name string + type Tier string + const TierFree + const TierHSM + const TierSoftware + const TierWrapped + type UpdateAPITokenParams struct + AllowedActions Patch[[]Action] + FirewallID Patch[string] + KeyIDs Patch[[]string] + type UpdateFirewallParams struct + AllowedIPs []string + Name string + type UpdatedAPIToken struct + PermissionChainHead ChainHead + type UsageLine struct + Allowance int64 + Cap int64 + ContainerID string + KeyID string + Ops int64 + OverageOps int64 + type User struct + CreatedAt time.Time + Email string + ID string + Name string