Documentation
¶
Index ¶
- Variables
- func MapToPairs(m map[string]string) []string
- func PairsToMap(pairs []string) map[string]string
- type AddOpts
- type Credentials
- type EnvExportsOpts
- type EnvFlags
- type EnvOptions
- type GenerateOpts
- type Inkube
- type InkubeShell
- type LifecycleHooks
- type Opts
- type ProcessComposeOpts
- type PullboxOpts
- type ShellOption
- type UpdateOpts
Constants ¶
This section is empty.
Variables ¶
var ErrNoRecognizableShellFound = errors.New("SHELL in undefined, and couldn't find any common shells in PATH")
Functions ¶
func MapToPairs ¶
func PairsToMap ¶
PairsToMap creates a map from a slice of "key=value" environment variable pairs. Note that maps are not ordered, which can affect the final variable values when pairs contains duplicate keys.
Types ¶
type Credentials ¶
type EnvExportsOpts ¶
type EnvExportsOpts struct {
EnvOptions EnvOptions
NoRefreshAlias bool
RunHooks bool
}
type EnvOptions ¶
type EnvOptions struct {
Hooks LifecycleHooks
OmitNixEnv bool
PreservePathStack bool
Pure bool
SkipRecompute bool
}
EnvOptions configure the Inkube Environment in the `computeEnv` function. - These options are commonly set by flags in some Inkube commands like `shellenv`, `shell` and `run`. - The struct is designed for the "common case" to be zero-initialized as `EnvOptions{}`.
type GenerateOpts ¶
type Inkube ¶
type Inkube struct{}
func (*Inkube) NewShell ¶
func (d *Inkube) NewShell(envOpts EnvOptions, opts ...ShellOption) (*InkubeShell, error)
newShell initializes the InkubeShell struct so it can be used to start a shell environment for the inkube project.
type InkubeShell ¶
type InkubeShell struct {
Inkube *Inkube
Name name
BinPath string
ProjectDir string // path to where inkube.json config resides
Env map[string]string
UserShellrcPath string
HistoryFile string
// ShellStartTime is the unix timestamp for when the command was invoked
ShellStartTime time.Time
}
InkubeShell configures a user's shell to run in Inkube. Its zero value is a fallback shell that launches a regular Nix shell.
func (*InkubeShell) Run ¶
func (s *InkubeShell) Run() error
type LifecycleHooks ¶
type LifecycleHooks struct {
// OnStaleState is called when the Inkube state is out of date
OnStaleState func()
}
type ProcessComposeOpts ¶
type PullboxOpts ¶
type PullboxOpts struct {
Overwrite bool
URL string
Credentials Credentials
}
type ShellOption ¶
type ShellOption func(*InkubeShell)
func WithEnvVariables ¶
func WithEnvVariables(envVariables map[string]string) ShellOption
TODO: Consider removing this once plugins add env vars directly to binaries via wrapper scripts.
func WithHistoryFile ¶
func WithHistoryFile(historyFile string) ShellOption
func WithProjectDir ¶
func WithProjectDir(projectDir string) ShellOption
func WithShellStartTime ¶
func WithShellStartTime(t time.Time) ShellOption