Versions in this module Expand all Collapse all v0 v0.2.0 Sep 2, 2026 Changes in this version + const SeedLength + var ErrRequestSeedTransmitted = errors.New("the request seed was about to be transmitted") + func NewSeed() ([]byte, error) + type Call struct + Body any + Headers map[string]string + Method string + Path string + Query url.Values type Client + func (c *Client) AccessLinkFor(shortCode string, seed []byte) (string, error) + func (c *Client) CollectLinkFor(shortCode string) string + func (c *Client) CreateRequest(ctx context.Context, params CreateRequestParams) (*SecureRequest, error) + func (c *Client) DeleteRequest(ctx context.Context, shortCode string) (*RequestDeletion, error) + func (c *Client) Do(ctx context.Context, call Call) (map[string]any, error) + func (c *Client) GetRequest(ctx context.Context, shortCode string) (*RequestSummary, error) + func (c *Client) GetStats(ctx context.Context) (*Stats, error) + func (c *Client) IterateRequests(ctx context.Context, limit int, fn func(RequestSummary) error) error + func (c *Client) IterateSubmissions(ctx context.Context, shortCode string, fn func(Submission) error) error + func (c *Client) ListRequests(ctx context.Context, limit, page int) (*RequestPage, error) + func (c *Client) ListSubmissions(ctx context.Context, shortCode string) (*SubmissionPage, error) + type CreateRequestParams struct + AccessCountsLeft int + Description string + ExpiredAt string + Fields []RequestField + IPWhitelist []string + IdempotencyKey string + MaxSubmission int + OrganizationID string + Passcode string + RequiresLogin bool + RequiresMfa bool + RestrictedDomain []string + Seed []byte + Title string + func (p CreateRequestParams) GoString() string + func (p CreateRequestParams) LogValue() slog.Value + func (p CreateRequestParams) MarshalJSON() ([]byte, error) + func (p CreateRequestParams) String() string + type DailyView struct + Count int + Date string type Field + func DecryptSubmission(data string, seed []byte) ([]Field, error) + type RequestDeletion struct + Outcome string + ShortCode string + type RequestField struct + Item string + Type string + type RequestPage struct + Limit int + Page int + Requests []RequestSummary + Total int + TotalPages int + func (p *RequestPage) HasMore() bool + type RequestSummary struct + ExpiredAt *string + PublicKey string + ShortCode string + type SecureRequest struct + AccessLink string + CollectLink string + ExpiredAt *string + PublicKey string + Seed []byte + ShortCode string + func (r SecureRequest) GoString() string + func (r SecureRequest) LogValue() slog.Value + func (r SecureRequest) MarshalJSON() ([]byte, error) + func (r SecureRequest) String() string type SeedKeypair + func (k SeedKeypair) GoString() string + func (k SeedKeypair) LogValue() slog.Value + func (k SeedKeypair) MarshalJSON() ([]byte, error) + func (k SeedKeypair) String() string + type ShareCounts struct + Active int + Expired int + TotalViewed int + type Stats struct + DailyViews []DailyView + Shares ShareCounts + type Submission struct + CreatedAt string + Data string + EncryptionType string + ShortCode string + func (s Submission) Decrypt(seed []byte) ([]Field, error) + type SubmissionPage struct + Count int + SkippedNotEndToEndEncrypted int + Submissions []Submission v0.1.4 Aug 31, 2026 v0.1.3 Aug 31, 2026 v0.1.2 Aug 31, 2026 v0.1.1 Aug 31, 2026 v0.1.0 Aug 31, 2026 Changes in this version + const DefaultBaseURL + const DefaultLinkOrigin + const DefaultMaxRetries + const DefaultTimeout + const SupportedVectorsVersion + const Version + var ErrAPI = errors.New("the API refused this request") + var ErrAuthentication = errors.New("the credential was not accepted") + var ErrCredentialFormat = errors.New("the credential is malformed") + var ErrCustodySecretTransmitted = errors.New("the custody secret was about to be transmitted") + var ErrDeliveryUnknown = errors.New("the request was delivered and its outcome is unknown") + var ErrIdempotencyConflict = errors.New("this Idempotency-Key was used with a different body") + var ErrInvalidField = errors.New("a field is not valid") + var ErrMalformedKey = errors.New("the key in the link is unusable") + var ErrMissingKey = errors.New("no key in the link") + var ErrNotFound = errors.New("no such share on this account") + var ErrNotSupported = errors.New("this operation is not exposed over the API by design") + var ErrPermission = errors.New("this credential may not do that") + var ErrQuotaExceeded = errors.New("the plan's share allowance is spent") + var ErrRateLimited = errors.New("too many requests") + var ErrServiceUnavailable = errors.New("the service could not resolve entitlements") + var ErrWireFormat = errors.New("the content could not be read") + var FieldTypes = []string + func AccessToken(contentKey []byte) (string, error) + func ConformanceVectorsJSON() []byte + func DecodeFragment(fragment string) ([]byte, error) + func EncodeFragment(contentKey []byte) (string, error) + func EncryptContent(contentKey []byte, fields []Field, opts ...EncryptOption) (string, error) + func NewContentKey() ([]byte, error) + func PasscodeVerifier(passcode string) (string, error) + func Retries(n int) *int + func UnwrapWithSeed(wrapped string, seed []byte) ([]byte, error) + func ValidateFields(fields []Field) error + func WrapToPublicKey(payload, recipientPublicKey []byte, opts ...WrapOption) (string, error) + type APIError struct + Code int + Message string + RequestID string + RetryAfter int + Status int + func (e *APIError) Error() string + func (e *APIError) Is(target error) bool + func (e *APIError) Unwrap() error + type Client struct + Credential *Credential + func New(credential string, opts *Options) (*Client, error) + func (c *Client) CreateShare(ctx context.Context, params CreateParams) (*Share, error) + func (c *Client) ExpireShare(ctx context.Context, shortCode string) error + func (c *Client) GetShare(ctx context.Context, shortCode string) (*ShareSummary, error) + func (c *Client) IterateShares(ctx context.Context, limit int, fn func(ShareSummary) error) error + func (c *Client) LinkFor(shortCode string, contentKey []byte) (string, error) + func (c *Client) ListShares(ctx context.Context, limit, page int) (*SharePage, error) + func (c *Client) ReadLink(_ string) ([]Field, error) + type ConformanceCheck struct + Name string + Run func() error + func ConformanceChecks() ([]ConformanceCheck, error) + type ConformanceFailure struct + Name string + Reason string + func RunConformance(verbose bool, log func(string)) (int, []ConformanceFailure, error) + type CreateParams struct + AccessCountsLeft int + ContentKey []byte + Custody bool + Description string + ExpiredAt string + Fields []Field + IdempotencyKey string + ItemKeyWrap string + OrganizationID string + Passcode string + TimedView int + Title string + type Credential struct + KeyID string + func ParseCredential(raw string) (*Credential, error) + func (c *Credential) CustodyPublicKey() (string, error) + func (c *Credential) GoString() string + func (c *Credential) HasCustody() bool + func (c *Credential) String() string + func (c *Credential) WrapToCustody(payload []byte) (string, error) + type EncryptOption func(*encryptConfig) + func WithPasscode(passcode string) EncryptOption + type Field struct + Extra map[string]json.RawMessage + Key string + Type string + Value string + func DecryptContent(contentKey []byte, blob string, passcode *string) ([]Field, error) + func (f *Field) UnmarshalJSON(data []byte) error + func (f Field) Equal(other Field) bool + func (f Field) MarshalJSON() ([]byte, error) + type Options struct + BaseURL string + HTTPClient *http.Client + LinkOrigin string + MaxRetries *int + Timeout time.Duration + type SeedKeypair struct + PrivateKey *ecdh.PrivateKey + PublicKeyB64URL string + PublicKeyRaw []byte + Scalar *big.Int + Seed []byte + func CustodyKeypair(custodySecret string) (*SeedKeypair, error) + func KeypairFromSeed(seed []byte) (*SeedKeypair, error) + type Share struct + ContentKey []byte + Custody string + ExpiredAt *string + Link string + ShortCode string + func (s *Share) String() string + type SharePage struct + Limit int + Page int + Shares []ShareSummary + Total int + TotalPages int + func (p *SharePage) HasMore() bool + type ShareSummary struct + ExpiredAt *string + ShortCode string + type WrapOption func(*wrapConfig)