bootstrap

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Overview

Package bootstrap initializes operator configuration without composing teams.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMissing marks an optional global Git key that is not configured.
	ErrMissing = errors.New("global Git key is absent")
	// ErrUnavailable marks an unavailable Git executable, allowing defaults only.
	ErrUnavailable = errors.New("git executable is unavailable")
)

Functions

This section is empty.

Types

type CommandGit

type CommandGit struct{}

CommandGit discovers global settings using context-aware Git subprocesses.

func (CommandGit) Lookup

func (CommandGit) Lookup(ctx context.Context, key string, boolean bool) (string, error)

type GitReader

type GitReader interface {
	Lookup(ctx context.Context, key string, boolean bool) (string, error)
}

GitReader reads global settings. Boolean lookups must use Git's conversion semantics and return canonical "true" or "false"; missing keys are ErrMissing. All other failures must remain distinguishable from missing settings.

type Options

type Options struct {
	Root  string
	Git   GitReader
	Force bool
}

Options supplies the operator configuration directory and global Git reader. Root must be absolute. A nil Git reader selects the real Git subprocess reader.

type Result

type Result struct {
	Path        string
	Created     bool
	Config      *config.TeamsConfig
	Diagnostics []string
}

Result describes the persisted configuration, including a competing creator's document when that invocation won publication. Diagnostics contain no key data.

func Run

func Run(ctx context.Context, opts Options) (Result, error)

Run preserves an existing valid configuration or creates the initial document. Force replaces the document with the initial configuration. It never prints, exits, fetches sources, or registers a team.

Jump to

Keyboard shortcuts

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