writers

package
v0.0.1-dev.fred-4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultWriter = dotenvWriter

	// A map of all writers available.
	FromName = map[string]Writer{
		dotenvWriter.Name(): dotenvWriter,
	}
)

Functions

This section is empty.

Types

type DotenvWriter

type DotenvWriter struct{}

Outputs the values in .env file format

func NewDotenvWriter

func NewDotenvWriter() *DotenvWriter

Create a new dotenv-format writer

func (*DotenvWriter) FormatEnvironmentValues

func (ew *DotenvWriter) FormatEnvironmentValues(values map[string]string) (string, error)

func (*DotenvWriter) Name

func (*DotenvWriter) Name() string

type Writer

type Writer interface {
	// Take in environment key/value pairs and format them.
	FormatEnvironmentValues(values map[string]string) (string, error)
	// Human-readable name of the writer, usually the output format.
	Name() string
}

Writers take environment values and create a string (usually to be written to a file) of a given format.

Jump to

Keyboard shortcuts

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