envx

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Code generated by genx:code DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var (
	TextMarshallerT   = reflect.TypeFor[encoding.TextMarshaler]()
	TextUnmarshallerT = reflect.TypeFor[encoding.TextUnmarshaler]()
)

Functions

func DotEnv

func DotEnv(values map[string]string) []byte

Types

type Code

type Code int8

Code defines env parsing error code +genx:code @def envx.Error

const (
	CODE_UNDEFINED                     Code = iota + 1
	CODE__DEC_INVALID_VALUE                 // cannot set value
	CODE__DEC_INVALID_VALUE_CANNOT_SET      // nil value
	CODE__DEC_INVALID_MAP_KEY_TYPE          // invalid map key type, expect alphabet string or positive integer
	CODE__DEC_FAILED_UNMARSHAL              // failed to unmarshal
	CODE__ENC_INVALID_MAP_KEY_TYPE          // invalid map key type, expect alphabet string or positive integer
	CODE__ENC_INVALID_MAP_KEY_VALUE         // invalid map key value, expect alphabet string or positive integer
	CODE__ENC_INVALID_ENV_KEY               // invalid env key, expect alphabet string
	CODE__ENC_FAILED_MARSHAL                // failed to marshal
	CODE__ENC_DUPLICATE_GROUP_KEY           // group key duplicated
)

func (Code) Message

func (e Code) Message() string

type Decoder

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

func NewDecoder

func NewDecoder(g *Group) *Decoder

func (*Decoder) Decode

func (d *Decoder) Decode(v any) error

type Encoder

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

func NewEncoder

func NewEncoder(g *Group) *Encoder

func (*Encoder) Encode

func (d *Encoder) Encode(v any) error

type Group

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

func NewGroup

func NewGroup(name string) *Group

func ParseGroupFromEnv

func ParseGroupFromEnv(prefix string) *Group

func (*Group) Add

func (g *Group) Add(v *Var) bool

func (*Group) Bytes

func (g *Group) Bytes() []byte

func (*Group) Get

func (g *Group) Get(key string) *Var

func (*Group) Key

func (g *Group) Key(key string) string

func (*Group) Len

func (g *Group) Len() int

func (*Group) MapEntries

func (g *Group) MapEntries(k string) []string

func (*Group) MaskBytes

func (g *Group) MaskBytes() []byte

func (*Group) Name

func (g *Group) Name() string

func (*Group) SliceLength

func (g *Group) SliceLength(k string) int

func (*Group) Values

func (g *Group) Values() map[string]*Var

type PathWalker

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

func NewPathWalker

func NewPathWalker() *PathWalker

func (*PathWalker) Enter

func (pw *PathWalker) Enter(i any)

func (*PathWalker) Leave

func (pw *PathWalker) Leave()

func (*PathWalker) Paths

func (pw *PathWalker) Paths() []any

func (*PathWalker) String

func (pw *PathWalker) String() string

type Var

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

func NewVar

func NewVar(key, val string) *Var

func (*Var) Key

func (v *Var) Key() string

func (*Var) Optional

func (v *Var) Optional() bool

func (*Var) Value

func (v *Var) Value() string

Jump to

Keyboard shortcuts

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