network

package
v0.1.0-M4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: Apache-2.0, EPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LibnetworkManagerServiceLocalID sets service local ID for libnetwork manager
	LibnetworkManagerServiceLocalID = "container-management.service.local.v1.service-libnetwork-manager"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerNetworkManager

type ContainerNetworkManager interface {
	// Manage performs any container network initialization operations that are needed so that a container is connectable afterwards
	Manage(ctx context.Context, container *types.Container) error

	// Connect is used to connect a container to a network.
	Connect(ctx context.Context, containers *types.Container) error

	// Disconnect disconnects the given container from given network
	Disconnect(ctx context.Context, container *types.Container, force bool) error

	// ReleaseNetworkResources releases all locally allocated resources for the container by the network manager implementation - e.g. network endpoints, etc.
	ReleaseNetworkResources(ctx context.Context, container *types.Container) error

	// Dispose manages stop and dispose of the network manager
	Dispose(ctx context.Context) error

	// Restore restores all networking resources for all running containers
	Restore(ctx context.Context, container []*types.Container) error

	// Initialize initializes all base networks for the manager depending on the modes supported - currently on bridge is supported
	Initialize(ctx context.Context) error

	// Stats retrieves the network statistics of the provided container
	Stats(ctx context.Context, container *types.Container) (*types.IOStats, error)
}

ContainerNetworkManager abstracts container's network operations

type NetOpt

type NetOpt func(netOpts *netOpts) error

NetOpt provides Network Manager Config Options

func WithLibNetDisableBridge

func WithLibNetDisableBridge(disableBridge bool) NetOpt

WithLibNetDisableBridge disables the default network bridge interface creation and usage.

func WithLibNetEnableIPv6

func WithLibNetEnableIPv6(enableIPv6 bool) NetOpt

WithLibNetEnableIPv6 enables IPv6

func WithLibNetExecRoot

func WithLibNetExecRoot(execRoot string) NetOpt

WithLibNetExecRoot sets network manager service's exec root.

func WithLibNetFixedCIDRv4

func WithLibNetFixedCIDRv4(fixedCIDRv4 string) NetOpt

WithLibNetFixedCIDRv4 sets network fixed CIDRv4.

func WithLibNetGatewayIPv4

func WithLibNetGatewayIPv4(gatewayIPv4 string) NetOpt

WithLibNetGatewayIPv4 sets network gateway IPv4.

func WithLibNetIPForward

func WithLibNetIPForward(ipForward bool) NetOpt

WithLibNetIPForward enables network IP forwarding

func WithLibNetIPMasq

func WithLibNetIPMasq(ipMasq bool) NetOpt

WithLibNetIPMasq sets network IP masquerade

func WithLibNetIPTables

func WithLibNetIPTables(ipTables bool) NetOpt

WithLibNetIPTables enables network IP tables

func WithLibNetIPV4

func WithLibNetIPV4(ipv4 string) NetOpt

WithLibNetIPV4 sets network IPv4.

func WithLibNetIcc

func WithLibNetIcc(icc bool) NetOpt

WithLibNetIcc enables network ICC

func WithLibNetMetaPath

func WithLibNetMetaPath(metaPath string) NetOpt

WithLibNetMetaPath sets network manager service's meta path.

func WithLibNetMtu

func WithLibNetMtu(mtu int) NetOpt

WithLibNetMtu sets network MTU

func WithLibNetName

func WithLibNetName(name string) NetOpt

WithLibNetName sets the default bridge network interface name.

func WithLibNetType

func WithLibNetType(netType string) NetOpt

WithLibNetType sets the default network interface type for the network manager service to use per container.

func WithLibNetUserlandProxy

func WithLibNetUserlandProxy(userlandProxy bool) NetOpt

WithLibNetUserlandProxy enables usage of a network userland proxy

Jump to

Keyboard shortcuts

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