Documentation
¶
Overview ¶
Package compose assembles a replica: it builds the application's handlers on their PostgreSQL and other outbound adapters and mounts the APIs on the edge. The serve command and the test kit's in-process server both use it, so tests exercise the replica that runs.
Index ¶
- func Bootstrap(d Deps) *appaccess.Bootstrap
- func Console(edge *flaghttp.Server, defaultLocale string) (bool, error)
- func CreateInstanceAdmin(d Deps) *appaccess.CreateInstanceAdmin
- func Hasher() *password.Hasher
- func InstanceAdminExists(d Deps) *appaccess.InstanceAdminExists
- func PromoteMember(d Deps) *appaccess.PromoteMember
- type Background
- type Deps
- type Listener
- type Options
- type Schedule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Console ¶
Console mounts the embedded console on edge, its entry document naming defaultLocale, and reports whether the binary holds a build of the console rather than the placeholder page.
func CreateInstanceAdmin ¶
func CreateInstanceAdmin(d Deps) *appaccess.CreateInstanceAdmin
CreateInstanceAdmin returns the use case adding an instance admin from the command line.
func Hasher ¶
Hasher returns the password hasher of a command line, which hashes one password and needs no bound.
func InstanceAdminExists ¶
func InstanceAdminExists(d Deps) *appaccess.InstanceAdminExists
InstanceAdminExists returns the query telling whether the instance has an instance admin.
func PromoteMember ¶
func PromoteMember(d Deps) *appaccess.PromoteMember
PromoteMember returns the use case making a member an instance admin from the command line.
Types ¶
type Background ¶
type Background struct {
// Workers are registered with the replica's runner.
Workers []worker.Worker
// Listeners are started on the replica's notification listeners.
Listeners []Listener
// Close ends the work the replica's use cases started on their own, such
// as the ruleset loads in flight; whoever runs the replica calls it once
// the requests are done.
Close func()
}
Background is the work a replica does besides answering requests, which whoever runs the replica starts.
func Management ¶
func Management(edge *flaghttp.Server, d Deps, reg prometheus.Registerer, o Options) Background
Management mounts the management API and the SDK API on edge, their metrics on reg, and returns the background work their use cases need.
type Options ¶
type Options struct {
// Keyring holds the instance's secret key, which session cookies are
// signed under.
Keyring *secret.Keyring
// PasswordHashConcurrency bounds the password hashes and verifications
// the replica runs at once.
PasswordHashConcurrency int
// RulesetLoadFault lets a test stall the replica's ruleset
// materializations; nil in production.
RulesetLoadFault *pgdelivery.RulesetLoadFault
// IngestHold lets a test keep a batch's transaction open; nil in
// production.
IngestHold *pgevents.IngestHold
// RateLimits are the limits of the SDK API.
RateLimits config.RateLimits
// EventsRetention is how long raw events are kept.
EventsRetention time.Duration
// EventsPartitionsAhead is how many days after today the raw event
// tables' partitions are created ahead of time.
EventsPartitionsAhead int
// SDKInventoryRetention is how long the SDK inventory keeps an SDK
// after it was last seen.
SDKInventoryRetention time.Duration
// WebhookTargets is what the operator allows a webhook subscription's
// target to be.
WebhookTargets governance.TargetPolicy
// WebhookTick is how often the replica fans the outbox out and sends the
// webhook deliveries that are due.
WebhookTick time.Duration
// WebhookSecretOverlap is how long a webhook subscription's rotated
// secret signs beside the new one.
WebhookSecretOverlap time.Duration
// Schedule is how change requests are scheduled and applied at their
// time.
Schedule Schedule
// AuditExportMaxEntries is the most entries one download of the audit
// log may hold.
AuditExportMaxEntries int
// DigestSlot is when the weekly stale-flag digest is sent.
DigestSlot governance.DigestSlot
management.Options
}
Options are how a replica serves, as its configuration sets them.