mirror of
https://github.com/wader/fq.git
synced 2024-11-23 00:57:15 +03:00
149cb3f45a
Ex: fq -d msgpack torepr file.msgpack Willoutput the JSON representation of the msgpack Make per format *_torepr functions internal
30 lines
539 B
Go
30 lines
539 B
Go
package decode
|
|
|
|
import "io/fs"
|
|
|
|
type Group []Format
|
|
|
|
type Dependency struct {
|
|
Names []string
|
|
Group *Group
|
|
}
|
|
|
|
type Format struct {
|
|
Name string
|
|
ProbeOrder int // probe order is from low to hi value then by name
|
|
Description string
|
|
Groups []string
|
|
DecodeFn func(d *D, in interface{}) interface{}
|
|
RootArray bool
|
|
RootName string
|
|
Dependencies []Dependency
|
|
Files fs.ReadDirFS
|
|
ToRepr string
|
|
}
|
|
|
|
func FormatFn(d func(d *D, in interface{}) interface{}) Group {
|
|
return Group{{
|
|
DecodeFn: d,
|
|
}}
|
|
}
|