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 ¶
View Source
var ErrNotPointerToStruct = errors.New("val must be a pointer to a struct")
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 // contains filtered or unexported fields }
Decoder provides methods for decoding variable values
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 ¶ added in v0.0.7
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 ScriptFunc ¶
type ScriptFunc func(ctx context.Context, opts ...interp.RunnerOption) error
type ScriptFuncWithSubshell ¶ added in v0.0.7
type VarNotFoundError ¶
type VarNotFoundError struct {
// contains filtered or unexported fields
}
func (VarNotFoundError) Error ¶
func (nfe VarNotFoundError) Error() string
Click to show internal directories.
Click to hide internal directories.