2020-10-13 05:24:11 +00:00
|
|
|
package {{.Version}}
|
|
|
|
|
2021-09-30 07:41:56 +00:00
|
|
|
// {{ .Banner }}
|
|
|
|
|
2020-10-13 05:24:11 +00:00
|
|
|
{{if gt (.ImportVersions | len) 0}}
|
|
|
|
import (
|
|
|
|
{{range $version := .ImportVersions}}
|
|
|
|
"gitlab.com/signald/signald-go/signald/client-protocol/{{$version}}"{{end}}
|
|
|
|
)
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
type Request struct {
|
2021-01-31 03:14:33 +00:00
|
|
|
ID string `json:"id" yaml:"id"`
|
|
|
|
Version string `json:"version" yaml:"version"`
|
|
|
|
Type string `json:"type" yaml:"type"`
|
2020-10-13 05:24:11 +00:00
|
|
|
}
|
|
|
|
{{ range $structName, $type := .Types }}{{if ne $type.Doc ""}}// {{$structName}}: {{$type.Doc}}{{end}}
|
|
|
|
type {{ $structName }} struct {
|
|
|
|
{{if $type.Request}} Request{{end}}
|
2021-01-31 03:14:33 +00:00
|
|
|
{{ range $fieldName, $field := $type.Fields }}{{ $field.FieldName }} {{if $field.List}}[]{{end}}{{ $field.Type }} `json:"{{$fieldName}},omitempty" yaml:"{{$fieldName}},omitempty"`{{if ne $field.Doc ""}} // {{$field.Doc}}{{end}}
|
2020-10-13 05:24:11 +00:00
|
|
|
{{ end }}}
|
|
|
|
{{ end }}
|