package drvregistry

import "github.com/docker/docker/libnetwork/drvregistry"

Index

Types

type DriverNotifyFunc

type DriverNotifyFunc func(name string, driver driverapi.Driver, capability driverapi.Capability) error

DriverNotifyFunc defines the notify function signature when a new network driver gets registered.

type DriverWalkFunc

type DriverWalkFunc func(name string, driver driverapi.Driver, capability driverapi.Capability) bool

DriverWalkFunc defines the network driver table walker function signature.

type DrvRegistry

type DrvRegistry struct {
	Networks
	IPAMs
	// contains filtered or unexported fields
}

DrvRegistry holds the registry of all network drivers and IPAM drivers that it knows about.

func New

New returns a new legacy driver registry.

Deprecated: use the separate Networks and IPAMs registries.

func (*DrvRegistry) AddDriver

func (r *DrvRegistry) AddDriver(_ string, fn InitFunc, config map[string]interface{}) error

AddDriver adds a network driver to the registry.

Deprecated: call fn(r, config) directly.

func (*DrvRegistry) Driver

func (r *DrvRegistry) Driver(name string) (driverapi.Driver, *driverapi.Capability)

Driver returns the network driver instance registered under name, and its capability.

func (*DrvRegistry) GetPluginGetter

func (r *DrvRegistry) GetPluginGetter() plugingetter.PluginGetter

GetPluginGetter returns the plugingetter

func (*DrvRegistry) IPAMDefaultAddressSpaces

func (r *DrvRegistry) IPAMDefaultAddressSpaces(name string) (string, string, error)

IPAMDefaultAddressSpaces returns the default address space strings for the passed IPAM driver name.

Deprecated: call GetDefaultAddressSpaces() on the IPAM driver.

type IPAMWalkFunc

type IPAMWalkFunc func(name string, driver ipamapi.Ipam, cap *ipamapi.Capability) bool

IPAMWalkFunc defines the IPAM driver table walker function signature.

type IPAMs

type IPAMs struct {
	// contains filtered or unexported fields
}

IPAMs is a registry of IPAM drivers. The zero value is an empty IPAM driver registry, ready to use.

func (*IPAMs) IPAM

func (ir *IPAMs) IPAM(name string) (ipamapi.Ipam, *ipamapi.Capability)

IPAM returns the actual IPAM driver instance and its capability which registered with the passed name.

func (*IPAMs) RegisterIpamDriver

func (ir *IPAMs) RegisterIpamDriver(name string, driver ipamapi.Ipam) error

RegisterIpamDriver registers the IPAM driver discovered with default capabilities.

func (*IPAMs) RegisterIpamDriverWithCapabilities

func (ir *IPAMs) RegisterIpamDriverWithCapabilities(name string, driver ipamapi.Ipam, caps *ipamapi.Capability) error

RegisterIpamDriverWithCapabilities registers the IPAM driver discovered with specified capabilities.

func (*IPAMs) WalkIPAMs

func (ir *IPAMs) WalkIPAMs(ifn IPAMWalkFunc)

WalkIPAMs walks the IPAM drivers registered in the registry and invokes the passed walk function and each one of them.

type InitFunc

type InitFunc func(driverapi.DriverCallback, map[string]interface{}) error

InitFunc defines the driver initialization function signature.

type Networks

type Networks struct {
	// Notify is called whenever a network driver is registered.
	Notify DriverNotifyFunc
	// contains filtered or unexported fields
}

Networks is a registry of network drivers. The zero value is an empty network driver registry, ready to use.

func (*Networks) Driver

func (nr *Networks) Driver(name string) (driverapi.Driver, driverapi.Capability)

Driver returns the network driver instance registered under name, and its capability.

func (*Networks) RegisterDriver

func (nr *Networks) RegisterDriver(ntype string, driver driverapi.Driver, capability driverapi.Capability) error

RegisterDriver registers the network driver with nr.

func (*Networks) WalkDrivers

func (nr *Networks) WalkDrivers(dfn DriverWalkFunc)

WalkDrivers walks the network drivers registered in the registry and invokes the passed walk function and each one of them.

type Placeholder

type Placeholder *struct{}

Placeholder is a type for function arguments which need to be present for Swarmkit to compile, but for which the only acceptable value is nil.

Source Files

drvregistry.go ipams.go networks.go

Version
v24.0.5+incompatible
Published
Jul 21, 2023
Platform
js/wasm
Imports
8 packages
Last checked
21 seconds ago

Tools for package owners.