diff options
author | Jhon Honce <jhonce@redhat.com> | 2021-09-13 14:29:22 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2021-09-14 07:47:24 -0700 |
commit | d7256be807890892c988cc7d270e3d1bf951397c (patch) | |
tree | 53fadc1842f3de6a7c62ab97c8e16f15b0dc4484 /pkg/bindings/generate | |
parent | b603c7a4b91d30b33ce987740156f46804f24074 (diff) | |
download | podman-d7256be807890892c988cc7d270e3d1bf951397c.tar.gz podman-d7256be807890892c988cc7d270e3d1bf951397c.tar.bz2 podman-d7256be807890892c988cc7d270e3d1bf951397c.zip |
Enhance bindings for IDE hints
* Follow https://pkg.go.dev/cmd/go#hdr-Generate_Go_files_by_processing_source
for leading comment
* Add godoc strings for all exposed methods for IDE support
* Copy field godoc strings into generated code as function godoc string
* Remove unused/unnecessary fields from generator.go structures
* Cleanup code regarding template usage
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'pkg/bindings/generate')
-rw-r--r-- | pkg/bindings/generate/types_kube_options.go | 20 | ||||
-rw-r--r-- | pkg/bindings/generate/types_systemd_options.go | 97 |
2 files changed, 51 insertions, 66 deletions
diff --git a/pkg/bindings/generate/types_kube_options.go b/pkg/bindings/generate/types_kube_options.go index 785e55dd4..0dd23afb0 100644 --- a/pkg/bindings/generate/types_kube_options.go +++ b/pkg/bindings/generate/types_kube_options.go @@ -1,3 +1,4 @@ +// Code generated by go generate; DO NOT EDIT. package generate import ( @@ -6,32 +7,27 @@ import ( "github.com/containers/podman/v3/pkg/bindings/internal/util" ) -/* -This file is generated automatically by go generate. Do not edit. -*/ - -// Changed +// Changed returns true if named field has been set func (o *KubeOptions) Changed(fieldName string) bool { return util.Changed(o, fieldName) } -// ToParams +// ToParams formats struct fields to be passed to API service func (o *KubeOptions) ToParams() (url.Values, error) { return util.ToParams(o) } -// WithService +// WithService set field Service to given value func (o *KubeOptions) WithService(value bool) *KubeOptions { - v := &value - o.Service = v + o.Service = &value return o } -// GetService +// GetService returns value of field Service func (o *KubeOptions) GetService() bool { - var service bool if o.Service == nil { - return service + var z bool + return z } return *o.Service } diff --git a/pkg/bindings/generate/types_systemd_options.go b/pkg/bindings/generate/types_systemd_options.go index 1cee2e16a..7a778a52b 100644 --- a/pkg/bindings/generate/types_systemd_options.go +++ b/pkg/bindings/generate/types_systemd_options.go @@ -1,3 +1,4 @@ +// Code generated by go generate; DO NOT EDIT. package generate import ( @@ -6,144 +7,132 @@ import ( "github.com/containers/podman/v3/pkg/bindings/internal/util" ) -/* -This file is generated automatically by go generate. Do not edit. -*/ - -// Changed +// Changed returns true if named field has been set func (o *SystemdOptions) Changed(fieldName string) bool { return util.Changed(o, fieldName) } -// ToParams +// ToParams formats struct fields to be passed to API service func (o *SystemdOptions) ToParams() (url.Values, error) { return util.ToParams(o) } -// WithUseName +// WithUseName set field UseName to given value func (o *SystemdOptions) WithUseName(value bool) *SystemdOptions { - v := &value - o.UseName = v + o.UseName = &value return o } -// GetUseName +// GetUseName returns value of field UseName func (o *SystemdOptions) GetUseName() bool { - var useName bool if o.UseName == nil { - return useName + var z bool + return z } return *o.UseName } -// WithNew +// WithNew set field New to given value func (o *SystemdOptions) WithNew(value bool) *SystemdOptions { - v := &value - o.New = v + o.New = &value return o } -// GetNew +// GetNew returns value of field New func (o *SystemdOptions) GetNew() bool { - var new bool if o.New == nil { - return new + var z bool + return z } return *o.New } -// WithNoHeader +// WithNoHeader set field NoHeader to given value func (o *SystemdOptions) WithNoHeader(value bool) *SystemdOptions { - v := &value - o.NoHeader = v + o.NoHeader = &value return o } -// GetNoHeader +// GetNoHeader returns value of field NoHeader func (o *SystemdOptions) GetNoHeader() bool { - var noHeader bool if o.NoHeader == nil { - return noHeader + var z bool + return z } return *o.NoHeader } -// WithRestartPolicy +// WithRestartPolicy set field RestartPolicy to given value func (o *SystemdOptions) WithRestartPolicy(value string) *SystemdOptions { - v := &value - o.RestartPolicy = v + o.RestartPolicy = &value return o } -// GetRestartPolicy +// GetRestartPolicy returns value of field RestartPolicy func (o *SystemdOptions) GetRestartPolicy() string { - var restartPolicy string if o.RestartPolicy == nil { - return restartPolicy + var z string + return z } return *o.RestartPolicy } -// WithStopTimeout +// WithStopTimeout set field StopTimeout to given value func (o *SystemdOptions) WithStopTimeout(value uint) *SystemdOptions { - v := &value - o.StopTimeout = v + o.StopTimeout = &value return o } -// GetStopTimeout +// GetStopTimeout returns value of field StopTimeout func (o *SystemdOptions) GetStopTimeout() uint { - var stopTimeout uint if o.StopTimeout == nil { - return stopTimeout + var z uint + return z } return *o.StopTimeout } -// WithContainerPrefix +// WithContainerPrefix set field ContainerPrefix to given value func (o *SystemdOptions) WithContainerPrefix(value string) *SystemdOptions { - v := &value - o.ContainerPrefix = v + o.ContainerPrefix = &value return o } -// GetContainerPrefix +// GetContainerPrefix returns value of field ContainerPrefix func (o *SystemdOptions) GetContainerPrefix() string { - var containerPrefix string if o.ContainerPrefix == nil { - return containerPrefix + var z string + return z } return *o.ContainerPrefix } -// WithPodPrefix +// WithPodPrefix set field PodPrefix to given value func (o *SystemdOptions) WithPodPrefix(value string) *SystemdOptions { - v := &value - o.PodPrefix = v + o.PodPrefix = &value return o } -// GetPodPrefix +// GetPodPrefix returns value of field PodPrefix func (o *SystemdOptions) GetPodPrefix() string { - var podPrefix string if o.PodPrefix == nil { - return podPrefix + var z string + return z } return *o.PodPrefix } -// WithSeparator +// WithSeparator set field Separator to given value func (o *SystemdOptions) WithSeparator(value string) *SystemdOptions { - v := &value - o.Separator = v + o.Separator = &value return o } -// GetSeparator +// GetSeparator returns value of field Separator func (o *SystemdOptions) GetSeparator() string { - var separator string if o.Separator == nil { - return separator + var z string + return z } return *o.Separator } |