env

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSelfBin means executable path is unknown.
	ErrSelfBin = errors.New("env: executable path unknown")
)

Functions

This section is empty.

Types

type Env

type Env struct {
	Opts  *Opts
	Plat  plat.Plat
	Paths *path.Paths
	Cfg   *base.Cfg
	Db    *bbolt.DB
	State *cmd.State
	Ver   string
}

Env represents env, used as a registry. State stores cmd state.

func Load

func Load(state *cmd.State) (*Env, error)

Load discovers directory paths and loads the env.

func Mock

func Mock(name string, dir string) (*Env, error)

Mock mocks for tests. Dir should be test's tmp dir. Name should be test name.

func (*Env) SetOpts

func (env *Env) SetOpts()

SetOpts sets opts.

type Opts

type Opts struct {
	NoAlerts   bool
	NoTicker   bool
	Unattended bool
}

Opts represents cli opts. --no-alerts --no-ticker --unattended

Directories

Path Synopsis
cfg
act
db

Jump to

Keyboard shortcuts

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