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

engineargs

package
v0.14.1 Latest Latest
Warning

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

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

Documentation

Overview

Package engineargs builds the rqlited command line and auth file for a SQL database's engine (ADR-0232 Decision 4), shared by the container entrypoint (cmd/funcd-rqlite) and the funcdctl dev engine (ADR-0237 Decision 2) so the two cannot drift. It imports only the standard library, so the static entrypoint stays small.

Index

Constants

View Source
const User = "funcd"

User is the engine user funcd calls the engine as; its password is the database's EnginePassword.

Variables

This section is empty.

Functions

func AuthFile

func AuthFile(password string) ([]byte, error)

AuthFile returns the auth file: User with every permission, and anonymous callers with readiness only, so the provider runtime's probe needs no credential.

func CDCConfig

func CDCConfig(endpoint, epoch string) ([]byte, error)

CDCConfig returns the change feed's config: every committed change posted to endpoint, with the engine's epoch as service_id (ADR-0235 Decision 1).

func Epoch

func Epoch(read func(string) ([]byte, error), write func(string, []byte, os.FileMode) error, path string) (string, error)

Epoch returns the epoch kept in the file at path beside an engine's data, writing a new one the first time: it lives as long as the data does (ADR-0235 Decision 1). read and write are os.ReadFile and os.WriteFile but in tests.

func NewEpoch

func NewEpoch() (string, error)

NewEpoch returns a random 128-bit epoch, which names one engine directory's Raft indexes (ADR-0235 Decision 1).

Types

type Args

type Args struct {
	NodeID      string // the database name
	HTTPAddr    string // the address rqlited binds for its HTTP API
	HTTPAdvAddr string // the advertised HTTP address; rqlited refuses an unspecified one
	RaftAddr    string // Raft stays on loopback, so a recreated engine with a new IP keeps its stored address
	AuthFile    string // the auth file, outside the durable directory
	DataDir     string // rqlited's data directory, inside the durable directory
	CDCConfig   string // the change feed's config file (ADR-0235); "" ⇒ no change feed
}

Args are an engine's addresses and paths.

func (Args) Argv

func (a Args) Argv() []string

Argv returns rqlited's arguments, without the program name.

Jump to

Keyboard shortcuts

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