env

package
v2.21.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SyntaxUsage

func SyntaxUsage() string

Types

type Flags

type Flags struct {
	File   string // --env-file
	Syntax Syntax // --env-syntax
	JSON   string // --env-json
}

func (*Flags) AddFlags

func (f *Flags) AddFlags(flagSet *pflag.FlagSet)

func (*Flags) PerhapsWrite

func (f *Flags) PerhapsWrite(env map[string]string) error

type Syntax

type Syntax int
const (
	SyntaxDocker Syntax = iota
	SyntaxCompose
	SyntaxSh
	SyntaxShExport
	SyntaxCsh
	SyntaxCshExport
	SyntaxPS
	SyntaxPSExport
	SyntaxCmd
	SyntaxJSON
)

func (*Syntax) Set

func (e *Syntax) Set(n string) error

Set uses a pointer receiver intentionally, even though the internal type is int, because it must change the actual receiver value.

func (Syntax) String

func (e Syntax) String() string

func (Syntax) Type

func (e Syntax) Type() string

func (Syntax) WriteEntry

func (e Syntax) WriteEntry(k, v string) (r string, err error)

WriteEntry will write the environment variable in a form that will make the target shell parse it correctly and verbatim.

func (Syntax) WriteToFileAndClose

func (e Syntax) WriteToFileAndClose(file *os.File, env map[string]string) (err error)

Jump to

Keyboard shortcuts

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