2020-06-08 03:29:51 +03:00
|
|
|
package decode
|
|
|
|
|
|
|
|
import "io/fs"
|
|
|
|
|
2021-11-17 18:46:10 +03:00
|
|
|
type Group []Format
|
|
|
|
|
2020-06-08 03:29:51 +03:00
|
|
|
type Dependency struct {
|
2021-11-17 18:46:10 +03:00
|
|
|
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{}
|
2021-11-03 19:19:33 +03:00
|
|
|
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
|
2022-01-10 20:25:36 +03:00
|
|
|
ToRepr string
|
2020-06-08 03:29:51 +03:00
|
|
|
}
|
|
|
|
|
2021-11-17 18:46:10 +03:00
|
|
|
func FormatFn(d func(d *D, in interface{}) interface{}) Group {
|
|
|
|
return Group{{
|
2020-06-08 03:29:51 +03:00
|
|
|
DecodeFn: d,
|
|
|
|
}}
|
|
|
|
}
|