config

package
v23.0.0-beta.1+incompa... Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidName

func IsValidName(name string) bool

IsValidName validates configuration objects supported by libnetwork

Types

type Config

type Config struct {
	Daemon          DaemonCfg
	Scopes          map[string]*datastore.ScopeCfg
	ActiveSandboxes map[string]interface{}
	PluginGetter    plugingetter.PluginGetter
}

Config encapsulates configurations of various Libnetwork components

func ParseConfig

func ParseConfig(tomlCfgFile string) (*Config, error)

ParseConfig parses the libnetwork configuration file

func ParseConfigOptions

func ParseConfigOptions(cfgOptions ...Option) *Config

ParseConfigOptions parses the configuration options and returns a reference to the corresponding Config structure

func (*Config) LoadDefaultScopes

func (c *Config) LoadDefaultScopes(dataDir string)

LoadDefaultScopes loads default scope configs for scopes which doesn't have explicit user specified configs.

func (*Config) ProcessOptions

func (c *Config) ProcessOptions(options ...Option)

ProcessOptions processes options and stores it in config

type DaemonCfg

type DaemonCfg struct {
	Debug                  bool
	Experimental           bool
	DataDir                string
	ExecRoot               string
	DefaultNetwork         string
	DefaultDriver          string
	Labels                 []string
	DriverCfg              map[string]interface{}
	ClusterProvider        cluster.Provider
	NetworkControlPlaneMTU int
	DefaultAddressPool     []*ipamutils.NetworkToSplit
}

DaemonCfg represents libnetwork core configuration

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]interface{}) Option

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

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 OptionDriverConfig

func OptionDriverConfig(networkType string, config map[string]interface{}) Option

OptionDriverConfig returns an option setter for driver configuration.

func OptionExecRoot

func OptionExecRoot(execRoot string) Option

OptionExecRoot function returns an option setter for exec root folder

func OptionExperimental

func OptionExperimental(exp bool) Option

OptionExperimental function returns an option setter for experimental daemon

func OptionLabels

func OptionLabels(labels []string) Option

OptionLabels function returns an option setter for labels

func OptionLocalKVProvider

func OptionLocalKVProvider(provider string) Option

OptionLocalKVProvider function returns an option setter for kvstore provider

func OptionLocalKVProviderConfig

func OptionLocalKVProviderConfig(config *store.Config) Option

OptionLocalKVProviderConfig function returns an option setter for kvstore config

func OptionLocalKVProviderURL

func OptionLocalKVProviderURL(url string) Option

OptionLocalKVProviderURL function returns an option setter for kvstore url

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.

Jump to

Keyboard shortcuts

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