setupwizard

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

This file keeps the wizard honest when DuckDB support is not compiled in. By setting the flag to false at build time, the wizard hides DuckDB from the database list so operators only see engines their binary can run.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Defaults

type Defaults struct {
	Port         int
	Domain       string
	NeedCert     bool
	DBType       string
	DBPath       string
	DBConn       string
	PGHost       string
	PGPort       string
	PGUser       string
	PGPassword   string
	PGDatabase   string
	SafecastLive bool
	ArchivePath  string
	ImportEnable bool
	ImportTGZURL string
	SupportEmail string
	BinaryPath   string
	WorkingDir   string
}

Defaults carries the starting values presented by the wizard so operators can speed through with sensible answers while still being free to tweak them. Keeping the struct small matches the Go proverb about simplicity beating cleverness: we only hold what the service file needs instead of mirroring every CLI flag.

type Result

type Result struct {
	ServiceName string
	ServicePath string
	LogPath     string
	UserUnit    bool
	ExecStart   []string
	Commands    []string
	EnableNotes []string
}

Result summarises what the wizard wrote to disk so the caller can show follow-up instructions. Returning structured data instead of printing from the installer makes the function easier to test and keeps side effects in one place.

func Run

func Run(ctx context.Context, in io.Reader, out io.Writer, defaults Defaults) (Result, error)

Run guides the operator through a coloured interactive setup, writes a systemd unit, and tries to enable it. Everything is time-bound via context so the caller can abort cleanly without mutexes or global state.

Jump to

Keyboard shortcuts

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