drvregistry

package
v0.0.0-...-652814a Latest Latest
Warning

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

Go to latest
Published: May 17, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 {
	sync.Mutex
	// contains filtered or unexported fields
}

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

func New

func New(lDs, gDs interface{}, dfn DriverNotifyFunc, ifn IPAMNotifyFunc, pg plugingetter.PluginGetter) (*DrvRegistry, error)

New returns a new driver registry handle.

func (*DrvRegistry) AddDriver

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

AddDriver adds a network driver to the registry.

func (*DrvRegistry) Driver

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

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

func (*DrvRegistry) GetPluginGetter

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

GetPluginGetter returns the plugingetter

func (*DrvRegistry) IPAM

func (r *DrvRegistry) IPAM(name string) (ipamapi.Ipam, *ipamapi.Capability)

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

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.

func (*DrvRegistry) RegisterDriver

func (r *DrvRegistry) RegisterDriver(ntype string, driver driverapi.Driver, capability driverapi.Capability) error

RegisterDriver registers the network driver when it gets discovered.

func (*DrvRegistry) RegisterIpamDriver

func (r *DrvRegistry) RegisterIpamDriver(name string, driver ipamapi.Ipam) error

RegisterIpamDriver registers the IPAM driver discovered with default capabilities.

func (*DrvRegistry) RegisterIpamDriverWithCapabilities

func (r *DrvRegistry) RegisterIpamDriverWithCapabilities(name string, driver ipamapi.Ipam, caps *ipamapi.Capability) error

RegisterIpamDriverWithCapabilities registers the IPAM driver discovered with specified capabilities.

func (*DrvRegistry) WalkDrivers

func (r *DrvRegistry) WalkDrivers(dfn DriverWalkFunc)

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

func (*DrvRegistry) WalkIPAMs

func (r *DrvRegistry) WalkIPAMs(ifn IPAMWalkFunc)

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

type IPAMNotifyFunc

type IPAMNotifyFunc func(name string, driver ipamapi.Ipam, cap *ipamapi.Capability) error

IPAMNotifyFunc defines the notify function signature when a new IPAM driver gets registered.

type IPAMWalkFunc

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

IPAMWalkFunc defines the IPAM driver table walker function signature.

type InitFunc

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

InitFunc defines the driver initialization function signature.

Jump to

Keyboard shortcuts

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