appdbapi

package
v1.160.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

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

func Register

func Register(mux *http.ServeMux, wrap func(http.Handler) http.Handler, cfg Config)

Register mounts the routes, each wrapped by wrap (the admin API's authentication and persona check).

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).

func Wrap

func Wrap(pg *postgres.Toolkit) Kit

Wrap is the postgres toolkit as these routes use it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL