operator

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package operator runs the gateway's local operator commands: install, enrol, migrate, backup and restore. They run only on the gateway host, never over HTTP, while the gateway is stopped: each holds the deployment's exclusive lock for its whole run, and records every change it makes in the audit log before reporting success.

It writes the database directly through store, the one place outside the controller that may, because no gateway can be running; it never imports the controller or the Admin API. The gateway's command line calls Run, and the configuration check calls CheckPaths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPaths

func CheckPaths(configPath string, cfg Config, command string, flags map[string]string) error

CheckPaths refuses a deployment whose files (the configuration at configPath, the database and its companions, the audit log and the trust keys) are not distinct regular paths, and operator files of command that would overwrite any of them.

func Run

func Run(command string, cfg Config, flags map[string]string) (int, error)

Run runs the operator command with its flags on the deployment cfg names; flags["config"] is the configuration file's path. It holds the deployment's lock for the whole command, across restore's SQLite file replacement, and returns the exit code.

Types

type Config

type Config struct {
	Database      string
	AuditLog      string
	AuditMaxBytes int64
	AuditMaxFiles int
	AuditTimeout  time.Duration
	KeyFiles      []string
}

Config is the part of the gateway's settings an operator command needs: the deployment's files, audit log limits and the trust key files, which no command may overwrite.

Jump to

Keyboard shortcuts

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