kernel

package
v0.0.0-...-292d0d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

func (*Kernel) AddCloser

func (k *Kernel) AddCloser(c io.Closer)

AddCloser registers a resource for reverse-order shutdown by Close.

func (*Kernel) Close

func (k *Kernel) Close() error

Close closes every registered resource in reverse-creation order.

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.
db
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL