Documentation
¶
Overview ¶
Package dependencies defines the resources and registration targets shared by application assembly and business modules. It imports no app or business module assembly packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resources ¶
type Resources struct {
DB *bun.DB
Transactions *database.TxManager
Cache cache.Store
RateLimiter ratelimit.Limiter
Mailer mail.Mailer
MailRenderer *mailview.Renderer
Disks map[string]*blob.Bucket
DefaultDisk string
Notifier *notification.Notifier
Pusher push.Sender
Media *media.Library
Logger *slog.Logger
TracerProvider trace.TracerProvider
MeterProvider metric.MeterProvider
Queue asynqx.Client
EventPublisher messaging.Publisher
}
Resources contains app-owned infrastructure borrowed by module registration and app assembly. App fills it before construction and closes resources after all users finish. Copying this bundle shares the same clients; modules must never close them. Disabled capabilities may be nil. DB and Transactions must use the same pool and be supplied together. Business services belong in explicit arguments. Platform capabilities are built once before business modules. Maps are read-only after assembly.
type Targets ¶
type Targets struct {
Migrations *migrate.Registry
RootCommand *cobra.Command
ScheduledCommands *cli.ScheduledCommands
TaskRouter *asynq.ServeMux
EventRouter *message.Router
EventSubscriber message.Subscriber
Seeders *seeders.Registry
// HTTP is the versioned typed business API. Register before services run.
HTTP huma.API
// AuthenticatedHTTP requires a validated bearer token and active session.
AuthenticatedHTTP huma.API
}
Targets contains borrowed startup registries. Register sequentially before execution, then leave them unchanged. Nil fields omit unused transports.