Documentation ¶
Index ¶
- func Connect(ctx context.Context, networkName string, ContainerNameOrID string, ...) error
- func Create(ctx context.Context, options *CreateOptions) (*entities.NetworkCreateReport, error)
- func Disconnect(ctx context.Context, networkName string, ContainerNameOrID string, ...) error
- func Exists(ctx context.Context, nameOrID string, options *ExistsOptions) (bool, error)
- func Inspect(ctx context.Context, nameOrID string, options *InspectOptions) ([]entities.NetworkInspectReport, error)
- func List(ctx context.Context, options *ListOptions) ([]*entities.NetworkListReport, error)
- func Prune(ctx context.Context, options *PruneOptions) ([]*entities.NetworkPruneReport, error)
- func Remove(ctx context.Context, nameOrID string, options *RemoveOptions) ([]*entities.NetworkRmReport, error)
- type ConnectOptions
- type CreateOptions
- func (o *CreateOptions) Changed(fieldName string) bool
- func (o *CreateOptions) GetDisableDNS() bool
- func (o *CreateOptions) GetDriver() string
- func (o *CreateOptions) GetGateway() net.IP
- func (o *CreateOptions) GetIPRange() net.IPNet
- func (o *CreateOptions) GetIPv6() bool
- func (o *CreateOptions) GetInternal() bool
- func (o *CreateOptions) GetLabels() map[string]string
- func (o *CreateOptions) GetMacVLAN() string
- func (o *CreateOptions) GetName() string
- func (o *CreateOptions) GetOptions() map[string]string
- func (o *CreateOptions) GetSubnet() net.IPNet
- func (o *CreateOptions) ToParams() (url.Values, error)
- func (o *CreateOptions) WithDisableDNS(value bool) *CreateOptions
- func (o *CreateOptions) WithDriver(value string) *CreateOptions
- func (o *CreateOptions) WithGateway(value net.IP) *CreateOptions
- func (o *CreateOptions) WithIPRange(value net.IPNet) *CreateOptions
- func (o *CreateOptions) WithIPv6(value bool) *CreateOptions
- func (o *CreateOptions) WithInternal(value bool) *CreateOptions
- func (o *CreateOptions) WithLabels(value map[string]string) *CreateOptions
- func (o *CreateOptions) WithMacVLAN(value string) *CreateOptions
- func (o *CreateOptions) WithName(value string) *CreateOptions
- func (o *CreateOptions) WithOptions(value map[string]string) *CreateOptions
- func (o *CreateOptions) WithSubnet(value net.IPNet) *CreateOptions
- type DisconnectOptions
- type ExistsOptions
- type InspectOptions
- type ListOptions
- type PruneOptions
- type RemoveOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
func Connect(ctx context.Context, networkName string, ContainerNameOrID string, options *ConnectOptions) error
Connect adds a container to a network
func Create ¶
func Create(ctx context.Context, options *CreateOptions) (*entities.NetworkCreateReport, 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 Inspect ¶
func Inspect(ctx context.Context, nameOrID string, options *InspectOptions) ([]entities.NetworkInspectReport, error)
Inspect returns low level information about a CNI network configuration
func List ¶
func List(ctx context.Context, options *ListOptions) ([]*entities.NetworkListReport, error)
List returns a summary of all CNI network configurations
func Prune ¶ added in v3.1.0
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 ConnectOptions ¶
type ConnectOptions struct { // Aliases are names the container will be known as // when using the dns plugin Aliases *[]string }
ConnectOptions are optional options for connecting containers from a network
func (*ConnectOptions) WithAliases ¶
func (o *ConnectOptions) WithAliases(value []string) *ConnectOptions
WithAliases
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) GetOptions ¶
func (o *CreateOptions) GetOptions() map[string]string
GetOptions
func (*CreateOptions) WithDisableDNS ¶
func (o *CreateOptions) WithDisableDNS(value bool) *CreateOptions
WithDisableDNS
func (*CreateOptions) WithDriver ¶
func (o *CreateOptions) WithDriver(value string) *CreateOptions
WithDriver
func (*CreateOptions) WithGateway ¶
func (o *CreateOptions) WithGateway(value net.IP) *CreateOptions
WithGateway
func (*CreateOptions) WithIPRange ¶
func (o *CreateOptions) WithIPRange(value net.IPNet) *CreateOptions
WithIPRange
func (*CreateOptions) WithIPv6 ¶
func (o *CreateOptions) WithIPv6(value bool) *CreateOptions
WithIPv6
func (*CreateOptions) WithInternal ¶
func (o *CreateOptions) WithInternal(value bool) *CreateOptions
WithInternal
func (*CreateOptions) WithLabels ¶
func (o *CreateOptions) WithLabels(value map[string]string) *CreateOptions
WithLabels
func (*CreateOptions) WithMacVLAN ¶
func (o *CreateOptions) WithMacVLAN(value string) *CreateOptions
WithMacVLAN
func (*CreateOptions) WithName ¶
func (o *CreateOptions) WithName(value string) *CreateOptions
WithName
func (*CreateOptions) WithOptions ¶
func (o *CreateOptions) WithOptions(value map[string]string) *CreateOptions
WithOptions
func (*CreateOptions) WithSubnet ¶
func (o *CreateOptions) WithSubnet(value net.IPNet) *CreateOptions
WithSubnet
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
func (*DisconnectOptions) ToParams ¶
func (o *DisconnectOptions) ToParams() (url.Values, error)
ToParams
func (*DisconnectOptions) WithForce ¶
func (o *DisconnectOptions) WithForce(value bool) *DisconnectOptions
WithForce
type ExistsOptions ¶ added in v3.1.0
type ExistsOptions struct { }
ExistsOptions are optional options for checking if a network exists
func (*ExistsOptions) Changed ¶ added in v3.1.0
func (o *ExistsOptions) Changed(fieldName string) bool
Changed
type InspectOptions ¶
type InspectOptions struct { }
InspectOptions are optional options for inspecting networks
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) WithFilters ¶
func (o *ListOptions) WithFilters(value map[string][]string) *ListOptions
WithFilters
type PruneOptions ¶ added in v3.1.0
type PruneOptions struct { }
PruneOptions are optional options for removing unused CNI networks
func (*PruneOptions) Changed ¶ added in v3.1.0
func (o *PruneOptions) Changed(fieldName string) bool
Changed
type RemoveOptions ¶
type RemoveOptions struct { // Force removes the network even if it is being used Force *bool }
RemoveOptions are optional options for inspecting networks
func (*RemoveOptions) WithForce ¶
func (o *RemoveOptions) WithForce(value bool) *RemoveOptions
WithForce