net

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package net provides options to configure new Docker (custom) networks.

Subpackages provide further driver-specific options:

Usage

To create a new internal custom Docker network, including IPAM pool configuration and bridge-specific configuration:

sess.CreateNetwork(ctx, "my-custom-notwork",
    net.WithInternal(),
    bridge.WithBridgeName("brrr-42"),
    net.WithIPAM(ipam.WithPool("0.0.1.0/24", ipam.WithRange("0.0.1.16/28"))),
)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt

type Opt func(*Options) error

Opt is a configuration option when creating a custom Docker network using github.com/thediveo/morbyd.Session.NewNetwork.

func WithDriver

func WithDriver(name string) Opt

WithDriver specifies the network driver (plugin) to use when creating a new Docker network. If left unspecified, it automatically defaults to Docker's “bridge” driver.

func WithIPAM

func WithIPAM(opts ...ipam.IPAMOpt) Opt

WithIPAM specifies the particular IPAM driver configuration to use for allocating IP addresses to containers getting attached to this network. See also ipam.Driver.

func WithIPv6

func WithIPv6() Opt

WithIPv6 enables IPv6 for the custom Docker network \o/.

func WithInternal

func WithInternal() Opt

WithInternal sets the Docker network to be created as “internal”.

func WithLabel

func WithLabel(label string) Opt

WithLabel adds a label in “KEY=VALUE” to the custom Docker network.

func WithLabels

func WithLabels(labels ...string) Opt

WithLabels adds multiple key-value labels to Docker network.

func WithOption

func WithOption(opt string) Opt

WithOption adds a driver option in “KEY=VALUE” format.

type Options

type Options types.NetworkCreate

Options represents the configuration options when creating a custom Docker network, including ipam configuration options.

Directories

Path Synopsis
Package bridge provides Docker “bridge”-driver specific network configuration options.
Package bridge provides Docker “bridge”-driver specific network configuration options.
Package ipvlan provides Docker “ipvlan”-driver specific network configuration options.
Package ipvlan provides Docker “ipvlan”-driver specific network configuration options.
Package macvlan provides Docker “macvlan”-driver specific network configuration options.
Package macvlan provides Docker “macvlan”-driver specific network configuration options.

Jump to

Keyboard shortcuts

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