Documentation
¶
Overview ¶
Package kernel holds the cross-cutting primitives every service receives.
Index ¶
Constants ¶
View Source
const Scope = "github.com/altalune-id/othra"
Scope is the instrumentation scope for the kernel's tracer and meter.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kernel ¶
type Kernel struct {
Log *slog.Logger
Pool db.Pool
Tracer trace.Tracer
Meter metric.Meter
Reporter *apperror.Reporter
// Queue is always non-nil: Disabled when queue.enabled is false.
Queue queue.Queue
// Storage is the file storage driver, nil when storage.driver is unset.
Storage storage.Driver
// contains filtered or unexported fields
}
Kernel is the platform bag handed to every service.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package authn turns the credential a request presents into a Principal and checks it against a permission table.
|
Package authn turns the credential a request presents into a Principal and checks it against a permission table. |
|
Package authz answers whether a Principal may perform a permission.
|
Package authz answers whether a Principal may perform a permission. |
|
Package capabilities derives the feature switches surfaces check instead of reading the deployment mode.
|
Package capabilities derives the feature switches surfaces check instead of reading the deployment mode. |
|
Package db is the database feature: the writer/reader pool, the unit of work and the Postgres error checks.
|
Package db is the database feature: the writer/reader pool, the unit of work and the Postgres error checks. |
|
dbtest
Package dbtest helps sqlmock tests expect the transactions kernel/db opens around every store call.
|
Package dbtest helps sqlmock tests expect the transactions kernel/db opens around every store call. |
|
Package events is the hardcoded catalog of outbound webhook event types and their payload versions, the public contract tenants receive.
|
Package events is the hardcoded catalog of outbound webhook event types and their payload versions, the public contract tenants receive. |
|
Package mailqueue is the durable mail queue on Postgres: messages are sealed at rest and erased once settled.
|
Package mailqueue is the durable mail queue on Postgres: messages are sealed at rest and erased once settled. |
|
Package outbox is the durable, tenant-scoped delivery queue on Postgres.
|
Package outbox is the durable, tenant-scoped delivery queue on Postgres. |
|
Package queue declares jobs and broadcasts and the Queue a driver carries them on.
|
Package queue declares jobs and broadcasts and the Queue a driver carries them on. |
|
nats
Package nats is the queue driver on NATS JetStream: streams WORK, DLQ and BROADCAST in one account.
|
Package nats is the queue driver on NATS JetStream: streams WORK, DLQ and BROADCAST in one account. |
|
Package ratelimit defines the Limiter contract that the memory and Redis stores implement.
|
Package ratelimit defines the Limiter contract that the memory and Redis stores implement. |
|
memory
Package memory is the in-process ratelimit store: GCRA over a bounded map, so limits are per instance.
|
Package memory is the in-process ratelimit store: GCRA over a bounded map, so limits are per instance. |
|
ratelimittest
Package ratelimittest is the contract test every ratelimit store runs.
|
Package ratelimittest is the contract test every ratelimit store runs. |
|
redis
Package redis is the shared ratelimit store: GCRA in one Lua script on Redis, so every server counts against one limit.
|
Package redis is the shared ratelimit store: GCRA in one Lua script on Redis, so every server counts against one limit. |
|
Package secret mints and hashes Othra's credentials: prefixed secrets shown once and opaque tokens, stored only as hashes.
|
Package secret mints and hashes Othra's credentials: prefixed secrets shown once and opaque tokens, stored only as hashes. |
|
Package session models the authenticated caller (Principal) and the store that keeps browser sessions.
|
Package session models the authenticated caller (Principal) and the store that keeps browser sessions. |
|
sessiontest
Package sessiontest holds the behavior every session.Store must share.
|
Package sessiontest holds the behavior every session.Store must share. |
|
Package storage is the file storage feature: signed direct uploads, their verification, object keys and URLs.
|
Package storage is the file storage feature: signed direct uploads, their verification, object keys and URLs. |
|
memory
Package memory is an in-process storage driver for tests: presigned URLs are fake and Put stands in for the browser.
|
Package memory is an in-process storage driver for tests: presigned URLs are fake and Put stands in for the browser. |
|
s3
Package s3 is the storage driver on an S3-compatible bucket: presigned PUT and GET, HEAD, ranged GET and DELETE.
|
Package s3 is the storage driver on an S3-compatible bucket: presigned PUT and GET, HEAD, ranged GET and DELETE. |
|
Package tenant carries the OrgID/ProjectID/UserID triple through the request lifecycle.
|
Package tenant carries the OrgID/ProjectID/UserID triple through the request lifecycle. |
|
Package tokens verifies the access tokens of one issuer for one resource server through oauthrs.
|
Package tokens verifies the access tokens of one issuer for one resource server through oauthrs. |
|
Package usage batches last-used writes on a ticker, so authenticating a credential never waits on one.
|
Package usage batches last-used writes on a ticker, so authenticating a credential never waits on one. |
Click to show internal directories.
Click to hide internal directories.