mirror of
https://github.com/wader/fq.git
synced 2024-11-30 18:08:16 +03:00
25 lines
534 B
Go
25 lines
534 B
Go
|
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{}
|
||
|
Dependencies []Dependency
|
||
|
FS fs.FS
|
||
|
}
|
||
|
|
||
|
func FormatFn(d func(d *D, in interface{}) interface{}) []*Format {
|
||
|
return []*Format{{
|
||
|
DecodeFn: d,
|
||
|
}}
|
||
|
}
|