mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
api/templates: vendor structfield template
Taken verbatim from
eee6eaf67f/generator/templates/structfield.gotmpl
so the alterations from the upstream template can be easily diffed.
Signed-off-by: Cory Snider <csnider@mirantis.com>
This commit is contained in:
41
api/templates/structfield.gotmpl
Normal file
41
api/templates/structfield.gotmpl
Normal file
@@ -0,0 +1,41 @@
|
||||
{{ define "structfield" }}
|
||||
{{- if not $.IsBaseType -}}
|
||||
// {{ template "docstring" . }}
|
||||
{{- template "propertyValidationDocString" .}}
|
||||
{{- end}}
|
||||
{{ pascalize .Name}} {{ template "schemaType" . }} {{ .PrintTags }}
|
||||
{{ end }}
|
||||
|
||||
{{- define "tuplefield" }}
|
||||
{{- if not $.IsBaseType -}}
|
||||
// {{ template "docstring" . }}
|
||||
{{- template "propertyValidationDocString" .}}
|
||||
{{ end }}
|
||||
{{- pascalize .Name}} {{ template "schemaType" . }} `json:"-"
|
||||
{{- if .CustomTag }} {{ .CustomTag }}{{ end }}` // custom serializer
|
||||
{{ end }}
|
||||
|
||||
{{- define "structfieldIface" }}
|
||||
{{- if not $.IsBaseType -}}
|
||||
// {{ template "docstring" . }}
|
||||
{{- template "propertyValidationDocString" .}}
|
||||
{{- end }}
|
||||
{{ pascalize .Name}}() {{ template "schemaType" . }}
|
||||
Set{{ pascalize .Name}}({{ template "schemaType" . }})
|
||||
{{ end }}
|
||||
{{ define "tuplefieldIface" }}
|
||||
{{- if not $.IsBaseType -}}
|
||||
// {{ template "docstring" . }}
|
||||
{{- template "propertyValidationDocString" . }}
|
||||
{{ end }}
|
||||
{{- pascalize .Name}}() {{ template "schemaType" . }}
|
||||
Set{{ pascalize .Name}}({{ template "schemaType" . }})
|
||||
{{ end }}
|
||||
|
||||
{{- define "privstructfield" }}
|
||||
{{- camelize .Name}}Field {{ template "schemaType" . }}
|
||||
{{ end }}
|
||||
|
||||
{{- define "privtuplefield" }}
|
||||
{{- camelize .Name}}Field {{ template "schemaType" . }}
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user