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 ¶
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 ¶
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 ¶
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.
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.