1
1
mirror of https://github.com/wader/fq.git synced 2024-11-23 00:57:15 +03:00
fq/pkg/decode/format.go

27 lines
588 B
Go
Raw Normal View History

2020-06-08 03:29:51 +03:00
package decode
import "io/fs"
type Dependency struct {
Names []string
Formats *[]*Format // TODO: rename to outFormats to make it clear it's used to assign?
}
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{}
2021-09-16 17:26:31 +03:00
RootV interface{}
RootName string
2020-06-08 03:29:51 +03:00
Dependencies []Dependency
2021-09-21 17:42:35 +03:00
Files fs.ReadDirFS
2020-06-08 03:29:51 +03:00
}
func FormatFn(d func(d *D, in interface{}) interface{}) []*Format {
return []*Format{{
DecodeFn: d,
}}
}