network

package
v4.2.0-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2022 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Overview

Code generated by go generate; DO NOT EDIT.

Code generated by go generate; DO NOT EDIT.

Code generated by go generate; DO NOT EDIT.

Code generated by go generate; DO NOT EDIT.

Code generated by go generate; DO NOT EDIT.

Code generated by go generate; DO NOT EDIT.

Code generated by go generate; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, networkName string, containerNameOrID string, options *types.PerNetworkOptions) error

Connect adds a container to a network

func Create

func Create(ctx context.Context, network *types.Network) (types.Network, error)

Create makes a new CNI network configuration

func Disconnect

func Disconnect(ctx context.Context, networkName string, containerNameOrID string, options *DisconnectOptions) error

Disconnect removes a container from a given network

func Exists

func Exists(ctx context.Context, nameOrID string, options *ExistsOptions) (bool, error)

Exists returns true if a given network exists

func Inspect

func Inspect(ctx context.Context, nameOrID string, _ *InspectOptions) (types.Network, error)

Inspect returns low level information about a CNI network configuration

func List

func List(ctx context.Context, options *ListOptions) ([]types.Network, error)

List returns a summary of all CNI network configurations

func Prune

func Prune(ctx context.Context, options *PruneOptions) ([]*entities.NetworkPruneReport, error)

Prune removes unused CNI networks

func Remove

func Remove(ctx context.Context, nameOrID string, options *RemoveOptions) ([]*entities.NetworkRmReport, error)

Remove deletes a defined CNI network configuration by name. The optional force boolean will remove all containers associated with the network when set to true. A slice of NetworkRemoveReports are returned.

Types

type CreateOptions

type CreateOptions struct {
	// DisableDNS turns off use of DNSMasq for name resolution
	// on the network
	DisableDNS *bool
	// Driver is the name of network driver
	Driver *string
	// Gateway of the network
	Gateway *net.IP
	// Internal turns off communication outside the networking
	// being created
	Internal *bool
	// Labels are metadata that can be associated with the network
	Labels map[string]string
	// MacVLAN is the name of the macvlan network to associate with
	MacVLAN *string
	// Range is the CIDR description of leasable IP addresses
	IPRange *net.IPNet `scheme:"range"`
	// Subnet to use
	Subnet *net.IPNet
	// IPv6 means the network is ipv6 capable
	IPv6 *bool
	// Options are a mapping of driver options and values.
	Options map[string]string
	// Name of the network
	Name *string
}

CreateOptions are optional options for creating networks

func (*CreateOptions) Changed

func (o *CreateOptions) Changed(fieldName string) bool

Changed returns true if named field has been set

func (*CreateOptions) GetDisableDNS

func (o *CreateOptions) GetDisableDNS() bool

GetDisableDNS returns value of field DisableDNS

func (*CreateOptions) GetDriver

func (o *CreateOptions) GetDriver() string

GetDriver returns value of field Driver

func (*CreateOptions) GetGateway

func (o *CreateOptions) GetGateway() net.IP

GetGateway returns value of field Gateway

func (*CreateOptions) GetIPRange

func (o *CreateOptions) GetIPRange() net.IPNet

GetIPRange returns value of field IPRange

func (*CreateOptions) GetIPv6

func (o *CreateOptions) GetIPv6() bool

GetIPv6 returns value of field IPv6

func (*CreateOptions) GetInternal

func (o *CreateOptions) GetInternal() bool

GetInternal returns value of field Internal

func (*CreateOptions) GetLabels

func (o *CreateOptions) GetLabels() map[string]string

GetLabels returns value of field Labels

func (*CreateOptions) GetMacVLAN

func (o *CreateOptions) GetMacVLAN() string

GetMacVLAN returns value of field MacVLAN

func (*CreateOptions) GetName

func (o *CreateOptions) GetName() string

GetName returns value of field Name

func (*CreateOptions) GetOptions

func (o *CreateOptions) GetOptions() map[string]string

GetOptions returns value of field Options

func (*CreateOptions) GetSubnet

func (o *CreateOptions) GetSubnet() net.IPNet

GetSubnet returns value of field Subnet

func (*CreateOptions) ToParams

func (o *CreateOptions) ToParams() (url.Values, error)

ToParams formats struct fields to be passed to API service

func (*CreateOptions) WithDisableDNS

func (o *CreateOptions) WithDisableDNS(value bool) *CreateOptions

WithDisableDNS set field DisableDNS to given value

func (*CreateOptions) WithDriver

func (o *CreateOptions) WithDriver(value string) *CreateOptions

WithDriver set field Driver to given value

func (*CreateOptions) WithGateway

func (o *CreateOptions) WithGateway(value net.IP) *CreateOptions

WithGateway set field Gateway to given value

func (*CreateOptions) WithIPRange

func (o *CreateOptions) WithIPRange(value net.IPNet) *CreateOptions

WithIPRange set field IPRange to given value

func (*CreateOptions) WithIPv6

func (o *CreateOptions) WithIPv6(value bool) *CreateOptions

WithIPv6 set field IPv6 to given value

func (*CreateOptions) WithInternal

func (o *CreateOptions) WithInternal(value bool) *CreateOptions

WithInternal set field Internal to given value

func (*CreateOptions) WithLabels

func (o *CreateOptions) WithLabels(value map[string]string) *CreateOptions

WithLabels set field Labels to given value

func (*CreateOptions) WithMacVLAN

func (o *CreateOptions) WithMacVLAN(value string) *CreateOptions

WithMacVLAN set field MacVLAN to given value

func (*CreateOptions) WithName

func (o *CreateOptions) WithName(value string) *CreateOptions

WithName set field Name to given value

func (*CreateOptions) WithOptions

func (o *CreateOptions) WithOptions(value map[string]string) *CreateOptions

WithOptions set field Options to given value

func (*CreateOptions) WithSubnet

func (o *CreateOptions) WithSubnet(value net.IPNet) *CreateOptions

WithSubnet set field Subnet to given value

type DisconnectOptions

type DisconnectOptions struct {
	// Force indicates to remove the container from
	// the network forcibly
	Force *bool
}

DisconnectOptions are optional options for disconnecting containers from a network

func (*DisconnectOptions) Changed

func (o *DisconnectOptions) Changed(fieldName string) bool

Changed returns true if named field has been set

func (*DisconnectOptions) GetForce

func (o *DisconnectOptions) GetForce() bool

GetForce returns value of field Force

func (*DisconnectOptions) ToParams

func (o *DisconnectOptions) ToParams() (url.Values, error)

ToParams formats struct fields to be passed to API service

func (*DisconnectOptions) WithForce

func (o *DisconnectOptions) WithForce(value bool) *DisconnectOptions

WithForce set field Force to given value

type ExistsOptions

type ExistsOptions struct {
}

ExistsOptions are optional options for checking if a network exists

func (*ExistsOptions) Changed

func (o *ExistsOptions) Changed(fieldName string) bool

Changed returns true if named field has been set

func (*ExistsOptions) ToParams

func (o *ExistsOptions) ToParams() (url.Values, error)

ToParams formats struct fields to be passed to API service

type InspectOptions

type InspectOptions struct {
}

InspectOptions are optional options for inspecting networks

func (*InspectOptions) Changed

func (o *InspectOptions) Changed(fieldName string) bool

Changed returns true if named field has been set

func (*InspectOptions) ToParams

func (o *InspectOptions) ToParams() (url.Values, error)

ToParams formats struct fields to be passed to API service

type ListOptions

type ListOptions struct {
	// Filters are applied to the list of networks to be more
	// specific on the output
	Filters map[string][]string
}

ListOptions are optional options for listing networks

func (*ListOptions) Changed

func (o *ListOptions) Changed(fieldName string) bool

Changed returns true if named field has been set

func (*ListOptions) GetFilters

func (o *ListOptions) GetFilters() map[string][]string

GetFilters returns value of field Filters

func (*ListOptions) ToParams

func (o *ListOptions) ToParams() (url.Values, error)

ToParams formats struct fields to be passed to API service

func (*ListOptions) WithFilters

func (o *ListOptions) WithFilters(value map[string][]string) *ListOptions

WithFilters set field Filters to given value

type PruneOptions

type PruneOptions struct {
	// Filters are applied to the prune of networks to be more
	// specific on choosing
	Filters map[string][]string
}

PruneOptions are optional options for removing unused CNI networks

func (*PruneOptions) Changed

func (o *PruneOptions) Changed(fieldName string) bool

Changed returns true if named field has been set

func (*PruneOptions) GetFilters

func (o *PruneOptions) GetFilters() map[string][]string

GetFilters returns value of field Filters

func (*PruneOptions) ToParams

func (o *PruneOptions) ToParams() (url.Values, error)

ToParams formats struct fields to be passed to API service

func (*PruneOptions) WithFilters

func (o *PruneOptions) WithFilters(value map[string][]string) *PruneOptions

WithFilters set field Filters to given value

type RemoveOptions

type RemoveOptions struct {
	// Force removes the network even if it is being used
	Force   *bool
	Timeout *uint
}

RemoveOptions are optional options for inspecting networks

func (*RemoveOptions) Changed

func (o *RemoveOptions) Changed(fieldName string) bool

Changed returns true if named field has been set

func (*RemoveOptions) GetForce

func (o *RemoveOptions) GetForce() bool

GetForce returns value of field Force

func (*RemoveOptions) GetTimeout

func (o *RemoveOptions) GetTimeout() uint

GetTimeout returns value of field Timeout

func (*RemoveOptions) ToParams

func (o *RemoveOptions) ToParams() (url.Values, error)

ToParams formats struct fields to be passed to API service

func (*RemoveOptions) WithForce

func (o *RemoveOptions) WithForce(value bool) *RemoveOptions

WithForce set field Force to given value

func (*RemoveOptions) WithTimeout

func (o *RemoveOptions) WithTimeout(value uint) *RemoveOptions

WithTimeout set field Timeout to given value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL