command

package
v0.1.36 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitCode

func ExitCode(err error) int

func IsPassphraseError added in v0.1.20

func IsPassphraseError(err error, kind PassphraseErrorKind) bool

func NewRoot

func NewRoot(deps Dependencies) *cobra.Command

func RenderError

func RenderError(w io.Writer, err error)

Types

type AuthorityPassphraseIntent added in v0.1.20

type AuthorityPassphraseIntent uint8
const (
	AuthorityPassphraseCreate AuthorityPassphraseIntent = iota + 1
	AuthorityPassphraseUnlock
)

type AuthorityPassphraseProvider added in v0.1.20

type AuthorityPassphraseProvider interface {
	Acquire(context.Context, AuthorityPassphraseRequest) ([]byte, error)
}

type AuthorityPassphraseRequest added in v0.1.20

type AuthorityPassphraseRequest struct {
	Intent     AuthorityPassphraseIntent
	Input      io.Reader
	Diagnostic io.Writer
}

type Dependencies

type Dependencies struct {
	In              io.Reader
	Out, Err        io.Writer
	Logger          *slog.Logger
	Version         string
	IsTerminal      func(io.Reader, io.Writer) bool
	Updater         UpdateService
	Initializer     *initialize.Service
	Resetter        *resetdomain.Service
	Migrator        *migration.Service
	Passphrases     AuthorityPassphraseProvider
	Profile         ExecutionProfile
	DevelopmentRoot string
}

type ExecutionProfile added in v0.1.27

type ExecutionProfile string
const (
	ProductionProfile  ExecutionProfile = "production"
	DevelopmentProfile ExecutionProfile = "development"
)

func ProfileForExecutable added in v0.1.28

func ProfileForExecutable(version, executable string) ExecutionProfile

ProfileForExecutable prevents a source-checkout build from becoming a production executable merely because Go embeds the checkout's tagged module version. Stable binaries outside a worktree remain production binaries.

func ProfileForVersion added in v0.1.27

func ProfileForVersion(version string) ExecutionProfile

type PassphraseError added in v0.1.20

type PassphraseError struct {
	Kind        PassphraseErrorKind
	Interaction bool
	// contains filtered or unexported fields
}

func (*PassphraseError) Error added in v0.1.20

func (e *PassphraseError) Error() string

type PassphraseErrorKind added in v0.1.20

type PassphraseErrorKind string
const (
	PassphraseCancelled   PassphraseErrorKind = "cancelled"
	PassphraseUnavailable PassphraseErrorKind = "unavailable"
	PassphraseLaunch      PassphraseErrorKind = "launch_failure"
	PassphraseProtocol    PassphraseErrorKind = "protocol_failure"
	PassphraseTimeout     PassphraseErrorKind = "timeout"
	PassphrasePolicy      PassphraseErrorKind = "policy_failure"
)

type UpdateService added in v0.1.4

type UpdateService interface {
	Run(context.Context, bool) (selfupdate.Result, error)
}

Jump to

Keyboard shortcuts

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