Documentation
¶
Index ¶
- Variables
- func RegisterFS(fs fs.ReadDirFS)
- func RegisterFormat(group *decode.Group, format *decode.Format)
- func RegisterFunc0[Tc any](name string, fn func(e *Interp, c Tc) any)
- func RegisterFunc1[Tc any, Ta0 any](name string, fn func(e *Interp, c Tc, a0 Ta0) any)
- func RegisterFunc2[Tc any, Ta0 any, Ta1 any](name string, fn func(e *Interp, c Tc, a0 Ta0, a1 Ta1) any)
- func RegisterIter0[Tc any](name string, fn func(e *Interp, c Tc) gojq.Iter)
- func RegisterIter1[Tc any, Ta0 any](name string, fn func(e *Interp, c Tc, a0 Ta0) gojq.Iter)
- func RegisterIter2[Tc any, Ta0 any, Ta1 any](name string, fn func(e *Interp, c Tc, a0 Ta0, a1 Ta1) gojq.Iter)
- func ToBitReader(v any) (bitio.ReaderAtSeeker, error)
- type ArrayDecodeValue
- func (dvb ArrayDecodeValue) DecodeValue() *decode.Value
- func (dvb ArrayDecodeValue) Display(w io.Writer, opts *Options) error
- func (dvb ArrayDecodeValue) ExtKeys() []string
- func (ArrayDecodeValue) ExtType() string
- func (v ArrayDecodeValue) JQValueEach() any
- func (v ArrayDecodeValue) JQValueHas(key any) any
- func (v ArrayDecodeValue) JQValueIndex(index int) any
- func (v ArrayDecodeValue) JQValueKey(name string) any
- func (v ArrayDecodeValue) JQValueKeys() any
- func (v ArrayDecodeValue) JQValueLength() any
- func (v ArrayDecodeValue) JQValueSlice(start int, end int) any
- func (v ArrayDecodeValue) JQValueSliceLen() any
- func (v ArrayDecodeValue) JQValueToGoJQ() any
- func (v ArrayDecodeValue) JQValueToGoJQEx(optsFn func() (*Options, error)) any
- func (dvb ArrayDecodeValue) ToBinary() (Binary, error)
- type Binary
- func (b Binary) Display(w io.Writer, opts *Options) error
- func (Binary) ExtKeys() []string
- func (Binary) ExtType() string
- func (b Binary) JQValueEach() any
- func (b Binary) JQValueHas(key any) any
- func (b Binary) JQValueIndex(index int) any
- func (b Binary) JQValueKey(name string) any
- func (b Binary) JQValueKeys() any
- func (b Binary) JQValueLength() any
- func (b Binary) JQValueSlice(start int, end int) any
- func (b Binary) JQValueSliceLen() any
- func (b Binary) JQValueToGoJQ() any
- func (b Binary) JQValueToGoJQEx(optsFn func() (*Options, error)) any
- func (b Binary) JQValueToNumber() any
- func (b Binary) JQValueToString() any
- func (b Binary) JQValueType() string
- func (b Binary) ToBinary() (Binary, error)
- type CompleteFn
- type DecodeValue
- type Decorator
- type Display
- type EnvFuncFn
- type EvalInstance
- type EvalOpts
- type Exiter
- type FileReader
- type FixedFileInfo
- type Input
- type Interp
- func (i *Interp) Eval(ctx context.Context, c any, expr string, opts EvalOpts) (gojq.Iter, error)
- func (i *Interp) EvalFunc(ctx context.Context, c any, name string, args []any, opts EvalOpts) (gojq.Iter, error)
- func (i *Interp) EvalFuncValues(ctx context.Context, c any, name string, args []any, opts EvalOpts) ([]any, error)
- func (i *Interp) Main(ctx context.Context, output Output, versionStr string) error
- func (i *Interp) Stop()
- type JQValueEx
- type OS
- type Options
- type Output
- type Platform
- type ReadlineOpts
- type Registry
- func (r *Registry) FS(fs fs.ReadDirFS)
- func (r *Registry) Format(group *decode.Group, format *decode.Format) *decode.Format
- func (r *Registry) Func(funcFn EnvFuncFn)
- func (r *Registry) Group(name string) (*decode.Group, error)
- func (r *Registry) Groups() map[string]*decode.Group
- func (r *Registry) MustAll() *decode.Group
- func (r *Registry) MustGroup(name string) *decode.Group
- type RunMode
- type StructDecodeValue
- func (dvb StructDecodeValue) DecodeValue() *decode.Value
- func (dvb StructDecodeValue) Display(w io.Writer, opts *Options) error
- func (dvb StructDecodeValue) ExtKeys() []string
- func (StructDecodeValue) ExtType() string
- func (v StructDecodeValue) JQValueEach() any
- func (v StructDecodeValue) JQValueHas(key any) any
- func (v StructDecodeValue) JQValueKey(name string) any
- func (v StructDecodeValue) JQValueKeys() any
- func (v StructDecodeValue) JQValueLength() any
- func (v StructDecodeValue) JQValueSliceLen() any
- func (v StructDecodeValue) JQValueToGoJQ() any
- func (v StructDecodeValue) JQValueToGoJQEx(optsFn func() (*Options, error)) any
- func (dvb StructDecodeValue) ToBinary() (Binary, error)
- type Terminal
- type ToBinary
- type Value
- type Variable
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultRegistry = NewRegistry()
DefaultRegistry global registry used by formats
View Source
var ErrEOF = io.EOF
View Source
var ErrInterrupt = errors.New("Interrupt")
Functions ¶
func RegisterFS ¶ added in v0.0.8
func RegisterFormat ¶ added in v0.0.8
func RegisterFunc0 ¶ added in v0.0.8
func RegisterFunc1 ¶ added in v0.0.8
func RegisterFunc2 ¶ added in v0.0.8
func RegisterIter0 ¶ added in v0.0.8
func RegisterIter1 ¶ added in v0.0.8
func RegisterIter2 ¶ added in v0.0.8
func ToBitReader ¶ added in v0.0.8
func ToBitReader(v any) (bitio.ReaderAtSeeker, error)
Types ¶
type ArrayDecodeValue ¶
type ArrayDecodeValue struct {
gojqx.Base
*decode.Compound
// contains filtered or unexported fields
}
func NewArrayDecodeValue ¶
func (ArrayDecodeValue) DecodeValue ¶
func (ArrayDecodeValue) JQValueEach ¶
func (v ArrayDecodeValue) JQValueEach() any
func (ArrayDecodeValue) JQValueHas ¶
func (v ArrayDecodeValue) JQValueHas(key any) any
func (ArrayDecodeValue) JQValueIndex ¶
func (v ArrayDecodeValue) JQValueIndex(index int) any
func (ArrayDecodeValue) JQValueKey ¶
func (v ArrayDecodeValue) JQValueKey(name string) any
func (ArrayDecodeValue) JQValueKeys ¶
func (v ArrayDecodeValue) JQValueKeys() any
func (ArrayDecodeValue) JQValueLength ¶
func (v ArrayDecodeValue) JQValueLength() any
func (ArrayDecodeValue) JQValueSlice ¶
func (v ArrayDecodeValue) JQValueSlice(start int, end int) any
func (ArrayDecodeValue) JQValueSliceLen ¶
func (v ArrayDecodeValue) JQValueSliceLen() any
func (ArrayDecodeValue) JQValueToGoJQ ¶
func (v ArrayDecodeValue) JQValueToGoJQ() any
func (ArrayDecodeValue) JQValueToGoJQEx ¶ added in v0.6.0
func (v ArrayDecodeValue) JQValueToGoJQEx(optsFn func() (*Options, error)) any
type Binary ¶ added in v0.0.5
type Binary struct {
// contains filtered or unexported fields
}
func NewBinaryFromBitReader ¶ added in v0.0.8
func (Binary) JQValueEach ¶ added in v0.0.5
func (Binary) JQValueHas ¶ added in v0.0.5
func (Binary) JQValueIndex ¶ added in v0.0.5
func (Binary) JQValueKey ¶ added in v0.0.5
func (Binary) JQValueKeys ¶ added in v0.0.5
func (Binary) JQValueLength ¶ added in v0.0.5
func (Binary) JQValueSliceLen ¶ added in v0.0.5
func (Binary) JQValueToGoJQ ¶ added in v0.0.5
func (Binary) JQValueToGoJQEx ¶ added in v0.7.0
func (Binary) JQValueToNumber ¶ added in v0.0.5
func (Binary) JQValueToString ¶ added in v0.0.5
func (Binary) JQValueType ¶ added in v0.0.5
type CompleteFn ¶ added in v0.5.0
type DecodeValue ¶
TODO: redo/rename used by _isDecodeValue
type Decorator ¶
type Decorator struct {
Null ansi.Code
False ansi.Code
True ansi.Code
Number ansi.Code
String ansi.Code
ObjectKey ansi.Code
Array ansi.Code
Object ansi.Code
Index ansi.Code
Value ansi.Code
DumpHeader ansi.Code
DumpAddr ansi.Code
Error ansi.Code
ValueColor func(v any) ansi.Code
ByteColor func(b byte) ansi.Code
Column string
}
type EvalInstance ¶ added in v0.0.8
type Exiter ¶
type Exiter interface {
ExitCode() int
}
gojq errors can implement this to signal exit code
type FileReader ¶
type FileReader struct {
R io.Reader
FileInfo FixedFileInfo
}
func (FileReader) Close ¶
func (FileReader) Close() error
type FixedFileInfo ¶
type FixedFileInfo struct {
FName string
FSize int64
FMode fs.FileMode
FModTime time.Time
FIsDir bool
FSys any
}
func (FixedFileInfo) IsDir ¶
func (ffi FixedFileInfo) IsDir() bool
func (FixedFileInfo) ModTime ¶
func (ffi FixedFileInfo) ModTime() time.Time
func (FixedFileInfo) Mode ¶
func (ffi FixedFileInfo) Mode() fs.FileMode
func (FixedFileInfo) Name ¶
func (ffi FixedFileInfo) Name() string
func (FixedFileInfo) Size ¶
func (ffi FixedFileInfo) Size() int64
func (FixedFileInfo) Sys ¶
func (ffi FixedFileInfo) Sys() any
type Interp ¶
type Interp struct {
Registry *Registry
OS OS
// new for each eval, other values are copied by value
EvalInstance EvalInstance
// contains filtered or unexported fields
}
func (*Interp) EvalFuncValues ¶
type OS ¶
type OS interface {
Platform() Platform
Stdin() Input
Stdout() Output
Stderr() Output
InterruptChan() chan struct{}
Args() []string
Environ() []string
ConfigDir() (string, error)
// FS.File returned by FS().Open() can optionally implement io.Seeker
FS() fs.FS
Readline(opts ReadlineOpts) (string, error)
History() ([]string, error)
}
type Options ¶
type Options struct {
Depth int
ArrayTruncate int
StringTruncate int
Verbose bool
Width int
DecodeProgress bool
Color bool
Colors map[string]string
ByteColors []struct {
Ranges [][2]int
Value string
}
Unicode bool
RawOutput bool
REPL bool
RawString bool
JoinString string
Compact bool
BitsFormat string
LineBytes int
DisplayBytes int
Addrbase int
Sizebase int
SkipGaps bool
Decorator Decorator
BitsFormatFn func(br bitio.ReaderAtSeeker) (any, error)
}
func OptionsFromValue ¶ added in v0.0.8
type ReadlineOpts ¶ added in v0.0.5
type ReadlineOpts struct {
Prompt string
CompleteFn CompleteFn
}
type Registry ¶ added in v0.0.8
type Registry struct {
EnvFuncFns []EnvFuncFn
FSs []fs.ReadDirFS
// contains filtered or unexported fields
}
func NewRegistry ¶ added in v0.0.8
func NewRegistry() *Registry
type StructDecodeValue ¶
type StructDecodeValue struct {
gojqx.Base
*decode.Compound
// contains filtered or unexported fields
}
func NewStructDecodeValue ¶
func (StructDecodeValue) DecodeValue ¶
func (StructDecodeValue) JQValueEach ¶
func (v StructDecodeValue) JQValueEach() any
func (StructDecodeValue) JQValueHas ¶
func (v StructDecodeValue) JQValueHas(key any) any
func (StructDecodeValue) JQValueKey ¶
func (v StructDecodeValue) JQValueKey(name string) any
func (StructDecodeValue) JQValueKeys ¶
func (v StructDecodeValue) JQValueKeys() any
func (StructDecodeValue) JQValueLength ¶
func (v StructDecodeValue) JQValueLength() any
func (StructDecodeValue) JQValueSliceLen ¶
func (v StructDecodeValue) JQValueSliceLen() any
func (StructDecodeValue) JQValueToGoJQ ¶
func (v StructDecodeValue) JQValueToGoJQ() any
func (StructDecodeValue) JQValueToGoJQEx ¶ added in v0.6.0
func (v StructDecodeValue) JQValueToGoJQEx(optsFn func() (*Options, error)) any
Click to show internal directories.
Click to hide internal directories.