2020-06-08 03:29:51 +03:00
|
|
|
package decode
|
|
|
|
|
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 {
|
2021-12-09 19:15:21 +03:00
|
|
|
Name string
|
|
|
|
ProbeOrder int // probe order is from low to hi value then by name
|
|
|
|
Description string
|
|
|
|
Groups []string
|
2022-07-19 19:33:50 +03:00
|
|
|
DecodeFn func(d *D, _ any) any
|
2022-05-20 16:10:41 +03:00
|
|
|
DecodeInArg any
|
|
|
|
DecodeOutType any
|
2021-12-09 19:15:21 +03:00
|
|
|
RootArray bool
|
|
|
|
RootName string
|
|
|
|
Dependencies []Dependency
|
|
|
|
Help FormatHelp
|
|
|
|
Functions []string
|
|
|
|
}
|
|
|
|
|
|
|
|
type HelpExample struct {
|
|
|
|
Comment string
|
|
|
|
Code string
|
|
|
|
}
|
|
|
|
|
|
|
|
type HelpFunction struct {
|
|
|
|
Name string
|
|
|
|
Examples []HelpExample
|
|
|
|
}
|
|
|
|
|
|
|
|
type HelpReference struct {
|
|
|
|
Title string
|
|
|
|
URL string
|
|
|
|
}
|
|
|
|
|
|
|
|
type FormatHelp struct {
|
|
|
|
Notes string
|
|
|
|
Functions []HelpFunction
|
|
|
|
References []HelpReference
|
2020-06-08 03:29:51 +03:00
|
|
|
}
|
|
|
|
|
2022-07-19 19:33:50 +03:00
|
|
|
func FormatFn(d func(d *D, _ any) any) Group {
|
2021-11-17 18:46:10 +03:00
|
|
|
return Group{{
|
2020-06-08 03:29:51 +03:00
|
|
|
DecodeFn: d,
|
|
|
|
}}
|
|
|
|
}
|