Documentation
¶
Overview ¶
Package everscribe is the top-level entry point for the Everscribe Go SDK. It binds a project's credentials once and hands out per-surface clients (recorder for ingest, minter for read-side embed-token minting) that share the same auth.
Typical usage:
import "github.com/everscribe/sdk-go"
es, err := everscribe.New(projectID, apiKey)
if err != nil {
log.Fatal(err)
}
rec := es.NewRecorder()
defer rec.Close()
m := es.NewMinter()
token, err := m.MintToken(ctx, minter.TokenOptions{...})
For 12-factor / containerized deployments, NewFromEnv reads EVERSCRIBE_PROJECT_ID and EVERSCRIBE_API_KEY from the process environment.
Customers who only need one surface can call its constructor directly - recorder.New(projectID, apiKey) and minter.New(projectID, apiKey) both still work and skip the SDK-client step.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a credential-bearing handle to an Everscribe project. It does not hold network state itself; subclient constructors (NewRecorder, NewMinter) build per-surface clients that own their own connections.
Reuse a single Client for the lifetime of the process; safe for concurrent use.
func New ¶
New returns a Client bound to projectID, authenticating subclient requests with apiKey. Both arguments are trimmed; an empty or whitespace-only value returns an error so configuration bugs surface at construction rather than at the first network call.
func NewFromEnv ¶
NewFromEnv constructs a Client from EVERSCRIBE_PROJECT_ID and EVERSCRIBE_API_KEY in the process environment, returning an error naming whichever variable is unset or empty after trimming.
Use it in 12-factor bootstraps so credentials stay out of source; call New directly when tests or CLIs pass credentials explicitly.
func (*Client) NewMinter ¶
NewMinter returns a minter client for the bound project. Forwarded options apply to the minter; see the minter package for the full list (WithBaseURL, WithHTTPClient).
func (*Client) NewRecorder ¶
func (c *Client) NewRecorder(opts ...recorder.RecorderOption) *recorder.BufferedRecorder
NewRecorder returns a buffered recorder for the bound project. Forwarded options apply to the recorder; see the recorder package for the full list (WithBufferSize, WithFlushInterval, WithBaseURL, etc.).
Directories
¶
| Path | Synopsis |
|---|---|
|
pkg
|
|
|
event
Package event is the audit-event domain: the record type, the per-request record lifecycle, and the framework adapters that drive it.
|
Package event is the audit-event domain: the record type, the per-request record lifecycle, and the framework adapters that drive it. |
|
minter
Package minter mints embed tokens used by the Everscribe embeddable component to display audit events from a customer's frontend without exposing the project API key.
|
Package minter mints embed tokens used by the Everscribe embeddable component to display audit events from a customer's frontend without exposing the project API key. |
|
recorder
Package recorder provides an append-only event recording client for the audit-log ingestion API.
|
Package recorder provides an append-only event recording client for the audit-log ingestion API. |