env

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator implements ENV format generation

func NewGenerator

func NewGenerator(opts *formats.Options) *Generator

NewGenerator creates a new ENV generator

func (*Generator) Generate

func (g *Generator) Generate(w io.Writer, data map[string]string) error

Generate writes ENV format to a writer

func (*Generator) GenerateExtended

func (g *Generator) GenerateExtended(w io.Writer, result *formats.ParseResult, opts *formats.GenerateOptions) error

GenerateExtended generates with additional options

func (*Generator) GenerateFile

func (g *Generator) GenerateFile(filename string, data map[string]string) error

GenerateFile writes ENV format to a file

func (*Generator) GenerateString

func (g *Generator) GenerateString(data map[string]string) (string, error)

GenerateString returns ENV format as a string

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler implements the ENV format handler

func NewHandler

func NewHandler(opts *formats.Options) *Handler

NewHandler creates a new ENV handler

func (*Handler) Extensions

func (h *Handler) Extensions() []string

Extensions returns supported file extensions

func (*Handler) Format

func (h *Handler) Format() formats.Format

Format returns the format type

func (*Handler) Generate

func (h *Handler) Generate(w io.Writer, data map[string]string) error

Generate implements Generator interface

func (*Handler) GenerateFile

func (h *Handler) GenerateFile(filename string, data map[string]string) error

GenerateFile implements Generator interface

func (*Handler) GenerateString

func (h *Handler) GenerateString(data map[string]string) (string, error)

GenerateString implements Generator interface

func (*Handler) GenerateWithComments

func (h *Handler) GenerateWithComments(w io.Writer, result *formats.ParseResult, opts *formats.GenerateOptions) error

GenerateWithComments generates ENV content with comments

func (*Handler) Parse

func (h *Handler) Parse(r io.Reader) (map[string]string, error)

Parse implements Parser interface

func (*Handler) ParseFile

func (h *Handler) ParseFile(filename string) (map[string]string, error)

ParseFile implements Parser interface

func (*Handler) ParseString

func (h *Handler) ParseString(content string) (map[string]string, error)

ParseString implements Parser interface

func (*Handler) ParseWithComments

func (h *Handler) ParseWithComments(r io.Reader) (*formats.ParseResult, error)

ParseWithComments parses ENV content preserving comments

func (*Handler) Validate

func (h *Handler) Validate(content []byte) error

Validate implements Validator interface

func (*Handler) ValidateKey

func (h *Handler) ValidateKey(key string) error

ValidateKey implements Validator interface

func (*Handler) ValidateValue

func (h *Handler) ValidateValue(_ string) error

ValidateValue implements Validator interface

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser implements ENV format parsing

func NewParser

func NewParser(opts *formats.Options) *Parser

NewParser creates a new ENV parser

func (*Parser) Parse

func (p *Parser) Parse(r io.Reader) (map[string]string, error)

Parse parses ENV content from a reader

func (*Parser) ParseExtended

func (p *Parser) ParseExtended(r io.Reader) (*formats.ParseResult, error)

ParseExtended parses with additional metadata

func (*Parser) ParseFile

func (p *Parser) ParseFile(filename string) (map[string]string, error)

ParseFile parses ENV content from a file

func (*Parser) ParseString

func (p *Parser) ParseString(content string) (map[string]string, error)

ParseString parses ENV content from a string

Jump to

Keyboard shortcuts

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