Documentation
¶
Overview ¶
Package soro provides the application container for the Soro framework.
Index ¶
- type App
- type Option
- func WithAPI(httpAPI *api.API) Option
- func WithAudienceAuthorizer(authorizer api.AudienceAuthorizer) Option
- func WithConfig(settings *config.Config) Option
- func WithDatabase(db *database.DB) Option
- func WithEngines(engines ...engine.Engine) Option
- func WithEventOptions(options ...events.Option) Option
- func WithHealth(registry *health.Registry) Option
- func WithJobs(client *jobs.Client) Option
- func WithLogger(logger *slog.Logger) Option
- func WithMailTransport(transport mail.Transport) Option
- func WithMailer(client *mail.Client) Option
- func WithMiddleware(middleware ...api.Middleware) Option
- func WithObservability(provider *observability.Provider) Option
- func WithPreTransactionMiddleware(middleware ...api.Middleware) Option
- func WithRequestTransaction(initialize api.RequestTransactionInitializer) Option
- func WithWebhookOptions(options ...webhooks.Option) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Config *config.Config
DB *database.DB
API *api.API
Logger *slog.Logger
Jobs *jobs.Client
Mailer *mail.Client
Observability *observability.Provider
Health *health.Registry
Engines *engine.Registry
Events *events.Bus
Webhooks *webhooks.Registry
Settings *sorosettings.Store
// contains filtered or unexported fields
}
func (*App) EngineMigrationGroups ¶
EngineMigrationGroups returns engine migration declarations without creating a ledger or executing SQL.
func (*App) EngineMigrationPlan ¶
EngineMigrationPlan returns the immutable engine migration plan without creating a ledger or executing SQL.
type Option ¶
type Option func(*appSettings)
func WithAudienceAuthorizer ¶
func WithAudienceAuthorizer(authorizer api.AudienceAuthorizer) Option
WithAudienceAuthorizer connects endpoint audience policies to the application's principal scopes and software-client authentication.
func WithConfig ¶
func WithDatabase ¶
WithDatabase replaces database initialization. The App owns and closes db.
func WithEngines ¶
WithEngines explicitly links engines into the application. Engines are validated and mounted during New; declarations freeze at Finalize.
func WithEventOptions ¶
WithEventOptions configures bounded in-memory event delivery.
func WithHealth ¶
func WithLogger ¶
func WithMailTransport ¶
func WithMailer ¶
func WithMiddleware ¶
func WithMiddleware(middleware ...api.Middleware) Option
func WithObservability ¶
func WithObservability(provider *observability.Provider) Option
func WithPreTransactionMiddleware ¶
func WithPreTransactionMiddleware(middleware ...api.Middleware) Option
WithPreTransactionMiddleware installs authentication or routing middleware that must run before request-local database context is initialized.
func WithRequestTransaction ¶
func WithRequestTransaction(initialize api.RequestTransactionInitializer) Option
WithRequestTransaction enables a request-wide database transaction. The application initializer may set generic transaction-local PostgreSQL state; engines receive the resulting context through ordinary handlers and services and never need access to App.
func WithWebhookOptions ¶
WithWebhookOptions configures bounded webhook ingress on the default API.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package api wraps Huma with Soro routing, errors, resources, and middleware.
|
Package api wraps Huma with Soro routing, errors, resources, and middleware. |
|
Package auth defines Soro's authentication-neutral request principal context.
|
Package auth defines Soro's authentication-neutral request principal context. |
|
Package cli implements the Soro command-line interface.
|
Package cli implements the Soro command-line interface. |
|
cmd
|
|
|
soro
command
|
|
|
Package config loads and validates Soro's typed application configuration.
|
Package config loads and validates Soro's typed application configuration. |
|
Package database owns Soro's PostgreSQL pool, Bun bridge, and transactions.
|
Package database owns Soro's PostgreSQL pool, Bun bridge, and transactions. |
|
Package engine provides trusted, statically linked Soro engine composition.
|
Package engine provides trusted, statically linked Soro engine composition. |
|
Package errors defines stable errors shared by Soro's non-HTTP layers.
|
Package errors defines stable errors shared by Soro's non-HTTP layers. |
|
Package events provides typed, in-memory application events.
|
Package events provides typed, in-memory application events. |
|
examples
|
|
|
basic
Package basic is a compiling Phase 1 example application model.
|
Package basic is a compiling Phase 1 example application model. |
|
basic/cmd/demo
command
|
|
|
basic/cmd/server
command
|
|
|
Package factory provides typed, persistence-agnostic test data factories.
|
Package factory provides typed, persistence-agnostic test data factories. |
|
Package generate implements Soro's deterministic application and component generators.
|
Package generate implements Soro's deterministic application and component generators. |
|
Package health provides cheap liveness and dependency readiness endpoints.
|
Package health provides cheap liveness and dependency readiness endpoints. |
|
internal
|
|
|
testdb
Package testdb provides schema-isolated PostgreSQL databases to Soro tests.
|
Package testdb provides schema-isolated PostgreSQL databases to Soro tests. |
|
Package jobs wraps River with Soro transactions, options, and telemetry.
|
Package jobs wraps River with Soro transactions, options, and telemetry. |
|
Package lifecycle defines Soro's model operation hooks and change context.
|
Package lifecycle defines Soro's model operation hooks and change context. |
|
Package mail provides Soro messages, templates, transports, and queued delivery.
|
Package mail provides Soro messages, templates, transports, and queued delivery. |
|
Package migrate applies readable PostgreSQL migrations through Soro transactions.
|
Package migrate applies readable PostgreSQL migrations through Soro transactions. |
|
Package model provides Soro's persistence model primitives.
|
Package model provides Soro's persistence model primitives. |
|
Package observability owns Soro tracing, metrics, and HTTP instrumentation.
|
Package observability owns Soro tracing, metrics, and HTTP instrumentation. |
|
Package query parses and applies safe, resource-defined PostgreSQL queries.
|
Package query parses and applies safe, resource-defined PostgreSQL queries. |
|
Package repository provides typed PostgreSQL persistence for Soro models.
|
Package repository provides typed PostgreSQL persistence for Soro models. |
|
Package serializer keeps persistence models separate from public responses.
|
Package serializer keeps persistence models separate from public responses. |
|
Package settings provides engine-scoped configuration that is declared in code, stored per deployment, and optionally overridden per tenant.
|
Package settings provides engine-scoped configuration that is declared in code, stored per deployment, and optionally overridden per tenant. |
|
Package sorotest provides schema-isolated Soro application test helpers.
|
Package sorotest provides schema-isolated Soro application test helpers. |
|
Package validation provides Soro's HTTP-independent validation engine.
|
Package validation provides Soro's HTTP-independent validation engine. |
|
Package webhooks provides bounded, engine-scoped HTTP webhook ingress.
|
Package webhooks provides bounded, engine-scoped HTTP webhook ingress. |