Documentation
¶
Index ¶
- Variables
- func IsTruthy(value string) bool
- type Decoder
- func (d *Decoder) DecodeVar(name string, val any) error
- func (d *Decoder) DecodeVars(val any) error
- func (d *Decoder) GetFunc(name string) (ScriptFunc, bool)
- func (d *Decoder) GetFuncP(name string, prepare PrepareFunc) (ScriptFunc, bool)
- func (d *Decoder) GetFuncWithSubshell(name string) (ScriptFuncWithSubshell, bool)
- type InvalidTypeError
- type PrepareFunc
- type ScriptFunc
- type ScriptFuncWithSubshell
- type VarNotFoundError
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Decoder ¶
type Decoder struct {
Runner *interp.Runner
// Enable distro overrides (true by default)
Overrides bool
// Enable using like distros for overrides
LikeDistros bool
OverridesOpts *overrides.Opts
// contains filtered or unexported fields
}
Decoder provides methods for decoding variable values
func New ¶
New creates a new variable decoder
func (*Decoder) DecodeVar ¶
DecodeVar decodes a variable to val using reflection. Structs should use the "sh" struct tag.
func (*Decoder) DecodeVars ¶
DecodeVars decodes all variables to val using reflection. Structs should use the "sh" struct tag.
func (*Decoder) GetFunc ¶
func (d *Decoder) GetFunc(name string) (ScriptFunc, bool)
GetFunc returns a function corresponding to a bash function with the given name
func (*Decoder) GetFuncP ¶
func (d *Decoder) GetFuncP(name string, prepare PrepareFunc) (ScriptFunc, bool)
func (*Decoder) GetFuncWithSubshell ¶
func (d *Decoder) GetFuncWithSubshell(name string) (ScriptFuncWithSubshell, bool)
type InvalidTypeError ¶
type InvalidTypeError struct {
// contains filtered or unexported fields
}
func (InvalidTypeError) Error ¶
func (ite InvalidTypeError) Error() string
type ScriptFuncWithSubshell ¶
type VarNotFoundError ¶
type VarNotFoundError struct {
// contains filtered or unexported fields
}
func (VarNotFoundError) Error ¶
func (nfe VarNotFoundError) Error() string
Source Files
¶
- decoder.go
Click to show internal directories.
Click to hide internal directories.