Help us shape the future of Go! Take the 2026 Go Developer Survey

consoleapp

package
v0.97.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 67 Imported by: 0

Documentation

Overview

Package consoleapp is the importable command layer of the bintrail-console binary — the console sibling of the cliapp seam. cmd/bintrail-console is a thin main() over it; embedding distributions build their own console binary the same way and may install ext seams (e.g. ext.SetConsoleAuth for an external login flow) from main() before calling Main. The console server reads those seams at construction time, so installs after Main returns are never picked up.

The console is the MCP server with a web face: browse indexed row events with full before/after diffs, generate recovery (undo) SQL, and — when baselines are configured — run point-in-time reconstruct, all from a browser. The console NEVER executes SQL; recover produces a script you review and apply.

bintrail-console serve --index-dsn "user:pass@tcp(127.0.0.1:3306)/binlog_index"

Configuration mirrors the core CLI: a .bintrail.env (or ~/.config/bintrail/config.env) file is loaded on startup and the BINTRAIL_INDEX_DSN / BINTRAIL_CONSOLE_* env vars are honored with flag > env > default precedence.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(version, commitSHA, buildDate string) int

Main configures build metadata and runs the bintrail-console root command, returning the process exit code. Callers (cmd/bintrail-console, and external distributions embedding the console) are expected to pass their -ldflags-injected version values and os.Exit with the result.

func RunSQLWorkerIfInvoked added in v0.92.0

func RunSQLWorkerIfInvoked()

RunSQLWorkerIfInvoked is meant to be the FIRST line of a main() that embeds this package: when the process was started as the SQL sandbox worker (its first argument is sqlsandbox.WorkerCommand) it runs the job and exits, so whatever setup that main() does before calling Main is not repeated for every query. cmd/bintrail-console calls it. A main() that does not is still served by the hidden command below, one cobra dispatch later.

Types

type ActiveJob

type ActiveJob struct {
	EntryID  string
	IndexDSN string
}

ActiveJob pairs a supervised entry's id with its per-source index DSN, so the rotation provider can look the entry up in the registry (for its ArchiveS3) and read its resolved bintrail_id.

Jump to

Keyboard shortcuts

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