[go: up one dir, main page]

config

package
v2.0.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PlatformConfig

	DataDir string
	// ExecRoot is the base-path for libnetwork external key listeners
	// (created in "<ExecRoot>/libnetwork/<Controller-Short-ID>.sock"),
	// and is passed as "-exec-root: argument for "libnetwork-setkey".
	//
	// It is only used on Linux, but referenced in some "unix" files
	// (linux and freebsd).
	//
	// FIXME(thaJeztah): ExecRoot is only used for Controller.startExternalKeyListener(), but "libnetwork-setkey" is only implemented on Linux.
	ExecRoot               string
	DefaultNetwork         string
	DefaultDriver          string
	Labels                 []string
	ClusterProvider        cluster.Provider
	NetworkControlPlaneMTU int
	DefaultAddressPool     []*ipamutils.NetworkToSplit
	DatastoreBucket        string
	ActiveSandboxes        map[string]any
	PluginGetter           plugingetter.PluginGetter
	FirewallBackend        string
	Rootless               bool
	EnableUserlandProxy    bool
	UserlandProxyPath      string
}

Config encapsulates configurations of various Libnetwork components

func New

func New(opts ...Option) *Config

New creates a new Config and initializes it with the given Options.

type Option

type Option func(c *Config)

Option is an option setter function type used to pass various configurations to the controller

func OptionActiveSandboxes

func OptionActiveSandboxes(sandboxes map[string]any) Option

OptionActiveSandboxes function returns an option setter for passing the sandboxes which were active during previous daemon life

func OptionBridgeConfig

func OptionBridgeConfig(config bridge.Configuration) Option

OptionBridgeConfig returns an option setter for bridge driver config.

func OptionDataDir

func OptionDataDir(dataDir string) Option

OptionDataDir function returns an option setter for data folder

func OptionDefaultAddressPoolConfig

func OptionDefaultAddressPoolConfig(addressPool []*ipamutils.NetworkToSplit) Option

OptionDefaultAddressPoolConfig function returns an option setter for default address pool

func OptionDefaultDriver

func OptionDefaultDriver(dd string) Option

OptionDefaultDriver function returns an option setter for default driver

func OptionDefaultNetwork

func OptionDefaultNetwork(dn string) Option

OptionDefaultNetwork function returns an option setter for a default network

func OptionExecRoot

func OptionExecRoot(execRoot string) Option

OptionExecRoot function returns an option setter for exec root folder.

On Linux, it sets both the controller's ExecRoot and osl.basePath, whereas on FreeBSD, it only sets the controller's ExecRoot. It is a no-op on other platforms.

func OptionFirewallBackend

func OptionFirewallBackend(val string) Option

OptionFirewallBackend returns an option setter for selection of the firewall backend.

func OptionNetworkControlPlaneMTU

func OptionNetworkControlPlaneMTU(exp int) Option

OptionNetworkControlPlaneMTU function returns an option setter for control plane MTU

func OptionPluginGetter

func OptionPluginGetter(pg plugingetter.PluginGetter) Option

OptionPluginGetter returns a plugingetter for remote drivers.

func OptionRootless

func OptionRootless(rootless bool) Option

OptionRootless returns an option setter that indicates whether the daemon is running in rootless mode.

func OptionUserlandProxy

func OptionUserlandProxy(enabled bool, proxyPath string) Option

OptionUserlandProxy returns an option setter that indicates whether the userland proxy is enabled, and sets the path to the proxy binary.

type PlatformConfig

type PlatformConfig struct {
	BridgeConfig bridge.Configuration
}

PlatformConfig defines platform-specific configuration.

Jump to

Keyboard shortcuts

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