appdbapi

package
v1.167.0 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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