1
1
mirror of https://github.com/wader/fq.git synced 2024-12-02 12:45:53 +03:00
fq/pkg/decode/format.go

30 lines
539 B
Go
Raw Normal View History

2020-06-08 03:29:51 +03:00
package decode
import "io/fs"
type Group []Format
2020-06-08 03:29:51 +03:00
type Dependency struct {
Names []string
Group *Group
2020-06-08 03:29:51 +03:00
}
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
2021-09-16 17:26:31 +03:00
RootName string
2020-06-08 03:29:51 +03:00
Dependencies []Dependency
2021-09-21 17:42:35 +03:00
Files fs.ReadDirFS
ToRepr string
2020-06-08 03:29:51 +03:00
}
func FormatFn(d func(d *D, in interface{}) interface{}) Group {
return Group{{
2020-06-08 03:29:51 +03:00
DecodeFn: d,
}}
}