Documentation
¶
Overview ¶
Package appdbapi serves the admin surface for operating an application database (#2406, #2409, #2410, #2427): its health and history, drift and adopting an existing schema, maintenance, canceling and terminating a backend, and the administrator's console. It is mounted behind the admin API's authentication; every route is for administrators only, and every action is audited.
Index ¶
Constants ¶
View Source
const (
SourceConsole = "admin_console"
)
Audit sources and the tool names an action is audited under.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Kit is the live postgres toolkit, nil when none is registered.
Kit func() Kit
// Store keeps the platform's migrations.
Store appdbdrift.Store
// Watch is the sampling service: the history and the settings.
Watch *appdbwatch.Service
// Audit records every action; nil records none.
Audit middleware.AuditLogger
// Actor names who made a request: the administrator's address, or their
// user id without one.
Actor func(r *http.Request) string
// TakeOn puts a connection another replica saved into service here
// before the reload bus announces it, so a request that follows the save
// to this replica is answered as the saving replica answers it. Nil takes
// nothing on.
TakeOn func(ctx context.Context, kind, name string)
}
Config carries what the routes need from the parent.
type Kit ¶
type Kit interface {
appdbdrift.AdoptKit
appdbops.Maintainer
appdbconsole.Signaller
appdbconsole.Transactor
HasConnection(name string) bool
ListConnections() []toolkit.ConnectionDetail
}
Kit is the postgres toolkit as these routes use it (Wrap).
Click to show internal directories.
Click to hide internal directories.