Documentation
¶
Overview ¶
Package app wires configuration, the database, background jobs, the HTTP API and every domain package into one runnable process.
Index ¶
- func CampaignChangeHook(a *App) campaigns.ChangeHook
- func HeldSendCheck(a *App) func(ctx context.Context, workspaceID, campaignID uuid.UUID) error
- func NewHumaConfig() huma.Config
- func RegisterOperations(h huma.API)
- func SecretBox(cfg *config.Config, log *slog.Logger) (*secrets.Box, error)
- func SendRecheck(a *App) func(ctx context.Context, campaignID uuid.UUID) (approvals.SendRecheck, error)
- type App
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CampaignChangeHook ¶
func CampaignChangeHook(a *App) campaigns.ChangeHook
CampaignChangeHook re-checks a campaign's open approval after the composer saved it (the composer's campaigns.Service.AfterChange).
func HeldSendCheck ¶
HeldSendCheck is the send-time check the minute job runs for scheduled and held sends: it holds a send that turns Blocked or lost its approval (and tells people), and returns an error wrapping sending.ErrNotReady.
func NewHumaConfig ¶
NewHumaConfig returns the OpenAPI configuration shared by the server and the `reputecast openapi` command.
func RegisterOperations ¶
RegisterOperations registers every operation on h without a database, for generating the OpenAPI document. Handlers are never called.
func SecretBox ¶
SecretBox loads the encryption key (from config or the key file) and returns the box that seals secrets at rest.
func SendRecheck ¶
func SendRecheck(a *App) func(ctx context.Context, campaignID uuid.UUID) (approvals.SendRecheck, error)
SendRecheck is the recheck the sending engine runs as a send starts (its sending.Readiness, via readinessRecheck): Send Readiness again, and the approval must still cover the campaign. It records nothing; the engine holds the send when the verdict is Blocked.
Types ¶
type App ¶
type App struct {
Cfg *config.Config
Log *slog.Logger
Pool *pgxpool.Pool
Q *store.Queries
Secrets *secrets.Box
Audit *audit.Logger
Jobs *jobs.Client
JobReg *jobs.Registry
Auth *api.Authenticator
Metrics *prometheus.Registry
// Mail sends system mail through the System-stream provider.
Mail mailer.Sender
// Sending starts, pauses, resumes and cancels campaign sends; set by the
// sending domain's start hook.
Sending sending.Starter
// Links signs open, click, unsubscribe and preference tokens in emails.
Links *linktoken.Signer
// URLs builds public links (tracking, unsubscribe, preferences, archive,
// shared reports, provider webhooks) on the instance's public URL.
URLs publicurl.Builder
// PublicURL is that URL: the saved instance setting, else http.public_url
// (see wire_publicurl.go).
PublicURL *publicurl.Source
// contains filtered or unexported fields
}
App holds the shared dependencies every domain uses.
func New ¶
New connects to the database and builds every dependency. It does not start listeners or workers; see Run.
func (*App) CommunityRuntime ¶
CommunityRuntime is the App's community adapter runtime (tests that change the configuration stop its sync loop first).
func (*App) InvalidatePolicy ¶
func (a *App) InvalidatePolicy()
InvalidatePolicy drops the cached authentication policy after a change.
func (*App) SendingEngine ¶
SendingEngine returns the App's sending engine (the demo command drives it).
Source Files
¶
- app.go
- register.go
- wire_accessrequests.go
- wire_adapters.go
- wire_apikeys.go
- wire_approvals.go
- wire_audience.go
- wire_auditlog.go
- wire_automations.go
- wire_campaigns.go
- wire_connect.go
- wire_deliverability.go
- wire_forms.go
- wire_imports.go
- wire_instance.go
- wire_mcpserver.go
- wire_media.go
- wire_notify.go
- wire_overview.go
- wire_providers.go
- wire_publicurl.go
- wire_remote.go
- wire_reports.go
- wire_roles.go
- wire_segments.go
- wire_senders.go
- wire_sending.go
- wire_sessionext.go
- wire_systemmail.go
- wire_team.go
- wire_templates.go
- wire_webhooks.go
- wire_workspaces.go