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

51 lines
830 B
Go
Raw Normal View History

2020-06-08 03:29:51 +03:00
package decode
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, _ any) any
DecodeInArg any
DecodeOutType any
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
}
func FormatFn(d func(d *D, _ any) any) Group {
return Group{{
2020-06-08 03:29:51 +03:00
DecodeFn: d,
}}
}