env

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnterEnvHandler

type EnterEnvHandler func(envName string, env interface{}) error

EnterEnvHandler prepares the environment defined by env.

type GetEnvFileTitleHandler

type GetEnvFileTitleHandler func(envName, envFile string) string

GetEnvFileTitleHandler returns a humand readable title for the given env file.

type GetKeyHandler

type GetKeyHandler jcrypt.KeySource

GetKeyHandler returns the encryption key for encryption or decryption.

type Reader

type Reader struct {
	KeySource       GetKeyHandler
	EnterEnvHandler EnterEnvHandler
	GetEnvFileTitle GetEnvFileTitleHandler
	// contains filtered or unexported fields
}

Reader represents a reader object for environments.

func NewReader

func NewReader(homeDirName string) (*Reader, error)

NewReader returns a new environment reader using the given key source and enter environment handler.

func (*Reader) CreateOrReadEnvironment

func (e *Reader) CreateOrReadEnvironment(envName string, env interface{}) error

CreateOrReadEnvironment reads an existing environment with the given name or calls the enter environment reader.

func (*Reader) DeleteEnvironment added in v0.9.3

func (e *Reader) DeleteEnvironment(envName string) error

DeleteEnvironment deletes an existing environment.

func (*Reader) Dir added in v0.9.9

func (e *Reader) Dir() string

Dir returns the configuration directory.

func (*Reader) GetEnvironmentFiles

func (e *Reader) GetEnvironmentFiles() ([]os.FileInfo, error)

GetEnvironmentFiles returns an ordered list of files that contain environments.

func (*Reader) ListEnvironments added in v0.9.9

func (e *Reader) ListEnvironments() ([]string, error)

ListEnvironments returns a list of all environment titles.

func (*Reader) ReadEnvironment

func (e *Reader) ReadEnvironment(envName string, env interface{}) error

ReadEnvironment reads an existing environment.

func (*Reader) SelectEnvironment

func (e *Reader) SelectEnvironment(env interface{}) error

SelectEnvironment displays all configured environments in specified order and prompts the user.

Jump to

Keyboard shortcuts

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