summaryrefslogtreecommitdiff
path: root/pkg/bindings/network
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2021-09-13 14:29:22 -0700
committerMatthew Heon <mheon@redhat.com>2021-09-16 09:42:14 -0400
commit74bc365eb6f036a87313ffe5acd3561d3c44638f (patch)
treea758b7fc4fe7e35c1cfd344c4d432e75160b50fe /pkg/bindings/network
parente37883f13e6f9e659a044eaa5dba46bab166e3a6 (diff)
downloadpodman-74bc365eb6f036a87313ffe5acd3561d3c44638f.tar.gz
podman-74bc365eb6f036a87313ffe5acd3561d3c44638f.tar.bz2
podman-74bc365eb6f036a87313ffe5acd3561d3c44638f.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/network')
-rw-r--r--pkg/bindings/network/types_connect_options.go20
-rw-r--r--pkg/bindings/network/types_create_options.go130
-rw-r--r--pkg/bindings/network/types_disconnect_options.go20
-rw-r--r--pkg/bindings/network/types_exists_options.go9
-rw-r--r--pkg/bindings/network/types_inspect_options.go9
-rw-r--r--pkg/bindings/network/types_list_options.go20
-rw-r--r--pkg/bindings/network/types_prune_options.go20
-rw-r--r--pkg/bindings/network/types_remove_options.go20
8 files changed, 104 insertions, 144 deletions
diff --git a/pkg/bindings/network/types_connect_options.go b/pkg/bindings/network/types_connect_options.go
index c0e7a6f50..b7a465999 100644
--- a/pkg/bindings/network/types_connect_options.go
+++ b/pkg/bindings/network/types_connect_options.go
@@ -1,3 +1,4 @@
+// Code generated by go generate; DO NOT EDIT.
package network
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 *ConnectOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
-// ToParams
+// ToParams formats struct fields to be passed to API service
func (o *ConnectOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}
-// WithAliases
+// WithAliases set field Aliases to given value
func (o *ConnectOptions) WithAliases(value []string) *ConnectOptions {
- v := &value
- o.Aliases = v
+ o.Aliases = &value
return o
}
-// GetAliases
+// GetAliases returns value of field Aliases
func (o *ConnectOptions) GetAliases() []string {
- var aliases []string
if o.Aliases == nil {
- return aliases
+ var z []string
+ return z
}
return *o.Aliases
}
diff --git a/pkg/bindings/network/types_create_options.go b/pkg/bindings/network/types_create_options.go
index 5746a5b1f..1b1afebc1 100644
--- a/pkg/bindings/network/types_create_options.go
+++ b/pkg/bindings/network/types_create_options.go
@@ -1,3 +1,4 @@
+// Code generated by go generate; DO NOT EDIT.
package network
import (
@@ -7,192 +8,177 @@ 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 *CreateOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
-// ToParams
+// ToParams formats struct fields to be passed to API service
func (o *CreateOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}
-// WithDisableDNS
+// WithDisableDNS set field DisableDNS to given value
func (o *CreateOptions) WithDisableDNS(value bool) *CreateOptions {
- v := &value
- o.DisableDNS = v
+ o.DisableDNS = &value
return o
}
-// GetDisableDNS
+// GetDisableDNS returns value of field DisableDNS
func (o *CreateOptions) GetDisableDNS() bool {
- var disableDNS bool
if o.DisableDNS == nil {
- return disableDNS
+ var z bool
+ return z
}
return *o.DisableDNS
}
-// WithDriver
+// WithDriver set field Driver to given value
func (o *CreateOptions) WithDriver(value string) *CreateOptions {
- v := &value
- o.Driver = v
+ o.Driver = &value
return o
}
-// GetDriver
+// GetDriver returns value of field Driver
func (o *CreateOptions) GetDriver() string {
- var driver string
if o.Driver == nil {
- return driver
+ var z string
+ return z
}
return *o.Driver
}
-// WithGateway
+// WithGateway set field Gateway to given value
func (o *CreateOptions) WithGateway(value net.IP) *CreateOptions {
- v := &value
- o.Gateway = v
+ o.Gateway = &value
return o
}
-// GetGateway
+// GetGateway returns value of field Gateway
func (o *CreateOptions) GetGateway() net.IP {
- var gateway net.IP
if o.Gateway == nil {
- return gateway
+ var z net.IP
+ return z
}
return *o.Gateway
}
-// WithInternal
+// WithInternal set field Internal to given value
func (o *CreateOptions) WithInternal(value bool) *CreateOptions {
- v := &value
- o.Internal = v
+ o.Internal = &value
return o
}
-// GetInternal
+// GetInternal returns value of field Internal
func (o *CreateOptions) GetInternal() bool {
- var internal bool
if o.Internal == nil {
- return internal
+ var z bool
+ return z
}
return *o.Internal
}
-// WithLabels
+// WithLabels set field Labels to given value
func (o *CreateOptions) WithLabels(value map[string]string) *CreateOptions {
- v := value
- o.Labels = v
+ o.Labels = value
return o
}
-// GetLabels
+// GetLabels returns value of field Labels
func (o *CreateOptions) GetLabels() map[string]string {
- var labels map[string]string
if o.Labels == nil {
- return labels
+ var z map[string]string
+ return z
}
return o.Labels
}
-// WithMacVLAN
+// WithMacVLAN set field MacVLAN to given value
func (o *CreateOptions) WithMacVLAN(value string) *CreateOptions {
- v := &value
- o.MacVLAN = v
+ o.MacVLAN = &value
return o
}
-// GetMacVLAN
+// GetMacVLAN returns value of field MacVLAN
func (o *CreateOptions) GetMacVLAN() string {
- var macVLAN string
if o.MacVLAN == nil {
- return macVLAN
+ var z string
+ return z
}
return *o.MacVLAN
}
-// WithIPRange
+// WithIPRange set field IPRange to given value
func (o *CreateOptions) WithIPRange(value net.IPNet) *CreateOptions {
- v := &value
- o.IPRange = v
+ o.IPRange = &value
return o
}
-// GetIPRange
+// GetIPRange returns value of field IPRange
func (o *CreateOptions) GetIPRange() net.IPNet {
- var iPRange net.IPNet
if o.IPRange == nil {
- return iPRange
+ var z net.IPNet
+ return z
}
return *o.IPRange
}
-// WithSubnet
+// WithSubnet set field Subnet to given value
func (o *CreateOptions) WithSubnet(value net.IPNet) *CreateOptions {
- v := &value
- o.Subnet = v
+ o.Subnet = &value
return o
}
-// GetSubnet
+// GetSubnet returns value of field Subnet
func (o *CreateOptions) GetSubnet() net.IPNet {
- var subnet net.IPNet
if o.Subnet == nil {
- return subnet
+ var z net.IPNet
+ return z
}
return *o.Subnet
}
-// WithIPv6
+// WithIPv6 set field IPv6 to given value
func (o *CreateOptions) WithIPv6(value bool) *CreateOptions {
- v := &value
- o.IPv6 = v
+ o.IPv6 = &value
return o
}
-// GetIPv6
+// GetIPv6 returns value of field IPv6
func (o *CreateOptions) GetIPv6() bool {
- var iPv6 bool
if o.IPv6 == nil {
- return iPv6
+ var z bool
+ return z
}
return *o.IPv6
}
-// WithOptions
+// WithOptions set field Options to given value
func (o *CreateOptions) WithOptions(value map[string]string) *CreateOptions {
- v := value
- o.Options = v
+ o.Options = value
return o
}
-// GetOptions
+// GetOptions returns value of field Options
func (o *CreateOptions) GetOptions() map[string]string {
- var options map[string]string
if o.Options == nil {
- return options
+ var z map[string]string
+ return z
}
return o.Options
}
-// WithName
+// WithName set field Name to given value
func (o *CreateOptions) WithName(value string) *CreateOptions {
- v := &value
- o.Name = v
+ o.Name = &value
return o
}
-// GetName
+// GetName returns value of field Name
func (o *CreateOptions) GetName() string {
- var name string
if o.Name == nil {
- return name
+ var z string
+ return z
}
return *o.Name
}
diff --git a/pkg/bindings/network/types_disconnect_options.go b/pkg/bindings/network/types_disconnect_options.go
index a73675d4f..c95204447 100644
--- a/pkg/bindings/network/types_disconnect_options.go
+++ b/pkg/bindings/network/types_disconnect_options.go
@@ -1,3 +1,4 @@
+// Code generated by go generate; DO NOT EDIT.
package network
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 *DisconnectOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
-// ToParams
+// ToParams formats struct fields to be passed to API service
func (o *DisconnectOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}
-// WithForce
+// WithForce set field Force to given value
func (o *DisconnectOptions) WithForce(value bool) *DisconnectOptions {
- v := &value
- o.Force = v
+ o.Force = &value
return o
}
-// GetForce
+// GetForce returns value of field Force
func (o *DisconnectOptions) GetForce() bool {
- var force bool
if o.Force == nil {
- return force
+ var z bool
+ return z
}
return *o.Force
}
diff --git a/pkg/bindings/network/types_exists_options.go b/pkg/bindings/network/types_exists_options.go
index 4f33cdfbb..10430f9f5 100644
--- a/pkg/bindings/network/types_exists_options.go
+++ b/pkg/bindings/network/types_exists_options.go
@@ -1,3 +1,4 @@
+// Code generated by go generate; DO NOT EDIT.
package network
import (
@@ -6,16 +7,12 @@ 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 *ExistsOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
-// ToParams
+// ToParams formats struct fields to be passed to API service
func (o *ExistsOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}
diff --git a/pkg/bindings/network/types_inspect_options.go b/pkg/bindings/network/types_inspect_options.go
index 9f7497ed5..47426a605 100644
--- a/pkg/bindings/network/types_inspect_options.go
+++ b/pkg/bindings/network/types_inspect_options.go
@@ -1,3 +1,4 @@
+// Code generated by go generate; DO NOT EDIT.
package network
import (
@@ -6,16 +7,12 @@ 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 *InspectOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
-// ToParams
+// ToParams formats struct fields to be passed to API service
func (o *InspectOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}
diff --git a/pkg/bindings/network/types_list_options.go b/pkg/bindings/network/types_list_options.go
index fcbe23bd6..60281f2ba 100644
--- a/pkg/bindings/network/types_list_options.go
+++ b/pkg/bindings/network/types_list_options.go
@@ -1,3 +1,4 @@
+// Code generated by go generate; DO NOT EDIT.
package network
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 *ListOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
-// ToParams
+// ToParams formats struct fields to be passed to API service
func (o *ListOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}
-// WithFilters
+// WithFilters set field Filters to given value
func (o *ListOptions) WithFilters(value map[string][]string) *ListOptions {
- v := value
- o.Filters = v
+ o.Filters = value
return o
}
-// GetFilters
+// GetFilters returns value of field Filters
func (o *ListOptions) GetFilters() map[string][]string {
- var filters map[string][]string
if o.Filters == nil {
- return filters
+ var z map[string][]string
+ return z
}
return o.Filters
}
diff --git a/pkg/bindings/network/types_prune_options.go b/pkg/bindings/network/types_prune_options.go
index f17e09d69..06e4eb19c 100644
--- a/pkg/bindings/network/types_prune_options.go
+++ b/pkg/bindings/network/types_prune_options.go
@@ -1,3 +1,4 @@
+// Code generated by go generate; DO NOT EDIT.
package network
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 *PruneOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
-// ToParams
+// ToParams formats struct fields to be passed to API service
func (o *PruneOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}
-// WithFilters
+// WithFilters set field Filters to given value
func (o *PruneOptions) WithFilters(value map[string][]string) *PruneOptions {
- v := value
- o.Filters = v
+ o.Filters = value
return o
}
-// GetFilters
+// GetFilters returns value of field Filters
func (o *PruneOptions) GetFilters() map[string][]string {
- var filters map[string][]string
if o.Filters == nil {
- return filters
+ var z map[string][]string
+ return z
}
return o.Filters
}
diff --git a/pkg/bindings/network/types_remove_options.go b/pkg/bindings/network/types_remove_options.go
index f715c94c9..57fc4fa3a 100644
--- a/pkg/bindings/network/types_remove_options.go
+++ b/pkg/bindings/network/types_remove_options.go
@@ -1,3 +1,4 @@
+// Code generated by go generate; DO NOT EDIT.
package network
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 *RemoveOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
-// ToParams
+// ToParams formats struct fields to be passed to API service
func (o *RemoveOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}
-// WithForce
+// WithForce set field Force to given value
func (o *RemoveOptions) WithForce(value bool) *RemoveOptions {
- v := &value
- o.Force = v
+ o.Force = &value
return o
}
-// GetForce
+// GetForce returns value of field Force
func (o *RemoveOptions) GetForce() bool {
- var force bool
if o.Force == nil {
- return force
+ var z bool
+ return z
}
return *o.Force
}