cli

package
v2.5.4 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 21 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// PathEnvKey ...
	PathEnvKey = "ENVMAN_ENVSTORE_PATH"
	// PathKey ...
	PathKey = "path"

	// LogLevelEnvKey ...
	LogLevelEnvKey = "LOGLEVEL"
	// LogLevelKey ...
	LogLevelKey = "loglevel"

	// KeyKey ...
	KeyKey = "key"

	// ValueKey ...
	ValueKey = "value"

	// ValueFileKey ...
	ValueFileKey = "valuefile"

	// NoExpandKey ...
	NoExpandKey = "no-expand"

	// AppendKey ...
	AppendKey = "append"

	// SkipIfEmptyKey ...
	SkipIfEmptyKey = "skip-if-empty"

	// SensitiveKey ...
	SensitiveKey = "sensitive"

	// ToolEnvKey ...
	ToolEnvKey = "ENVMAN_TOOLMODE"
	// ToolKey ...
	ToolKey = "tool"

	// ClearKey ....
	ClearKey = "clear"

	// HelpKey ...
	HelpKey = "help"

	// VersionKey ...
	VersionKey = "version"

	// ExpandKey ...
	ExpandKey = "expand"
	// SensitiveOnlyKey ...
	SensitiveOnlyKey = "sensitive-only"
	// FormatKey ...
	FormatKey = "format"
	// OutputFormatRaw ...
	OutputFormatRaw = "raw"
	// OutputFormatJSON ...
	OutputFormatJSON = "json"
	// OutputFormatExport
	OutputFormatEnvList = "envlist"
)

Variables

View Source
var (
	// CurrentEnvStoreFilePath ...
	CurrentEnvStoreFilePath string

	// ToolMode ...
	ToolMode bool
)

Functions

func AddEnv

func AddEnv(envStorePth string, key string, value string, expand, replace, skipIfEmpty, sensitive bool) error

AddEnv ...

func ClearEnvs

func ClearEnvs(envStorePth string) error

ClearEnvs ...

func ConvertToEnvsJSONModel

func ConvertToEnvsJSONModel(envs []models.EnvironmentItemModel, expand, sensitiveOnly bool, envSource env.EnvironmentSource) (models.EnvsJSONListModel, error)

func InitEnvStore

func InitEnvStore(envStorePth string, clearEnvstore bool) error

InitEnvStore ...

func NewEnvVarValueTooLargeError

func NewEnvVarValueTooLargeError(key string, valueSizeInKB, maxSizeInKB float64) error

func ParseEnvsYML

func ParseEnvsYML(bytes []byte) ([]models.EnvironmentItemModel, error)

ParseEnvsYML ...

func ReadAndEvaluateEnvs

func ReadAndEvaluateEnvs(envStorePth string, envSource env.EnvironmentSource) ([]string, error)

ReadAndEvaluateEnvs ...

func ReadEnvs

func ReadEnvs(pth string) ([]models.EnvironmentItemModel, error)

ReadEnvs ...

func ReadEnvsJSONList

func ReadEnvsJSONList(envStorePth string, expand, sensitiveOnly bool, envSource env.EnvironmentSource) (models.EnvsJSONListModel, error)

ReadEnvsJSONList ...

func ReadEnvsOrCreateEmptyList

func ReadEnvsOrCreateEmptyList(envStorePth string) ([]models.EnvironmentItemModel, error)

ReadEnvsOrCreateEmptyList ...

func Run

func Run()

Run the Envman CLI.

func UpdateOrAddToEnvlist

func UpdateOrAddToEnvlist(oldEnvSlice []models.EnvironmentItemModel, newEnv models.EnvironmentItemModel, replace bool) ([]models.EnvironmentItemModel, error)

UpdateOrAddToEnvlist ...

func WriteEnvMapToFile

func WriteEnvMapToFile(pth string, envs []models.EnvironmentItemModel) error

WriteEnvMapToFile ...

Types

type CommandModel

type CommandModel struct {
	Command      string
	Arguments    []string
	Environments []models.EnvironmentItemModel
}

CommandModel ...

type EnvVarListTooLargeError

type EnvVarListTooLargeError struct {
	EnvListSizeInKB float64
	MaxSizeInKB     float64
}

func NewEnvVarListTooLargeError

func NewEnvVarListTooLargeError(envListSizeInKB, maxSizeInKB float64) EnvVarListTooLargeError

func (EnvVarListTooLargeError) Error

func (e EnvVarListTooLargeError) Error() string

type EnvVarValueTooLargeError

type EnvVarValueTooLargeError struct {
	Key           string
	ValueSizeInKB float64
	MaxSizeInKB   float64
}

func (EnvVarValueTooLargeError) Error

func (err EnvVarValueTooLargeError) Error() string

type VersionOutputModel

type VersionOutputModel struct {
	Version     string `json:"version"`
	BuildNumber string `json:"build_number"`
	Commit      string `json:"commit"`
}

VersionOutputModel ...

Jump to

Keyboard shortcuts

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