invoke

package
v0.7.0-alpha0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2018 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExecutableFileExtensions = []string{""}

Valid file extensions for plugin executables.

Functions

func DelegateAdd

func DelegateAdd(delegatePlugin string, netconf []byte) (types.Result, error)

DelegateAdd calls the given delegate plugin with the CNI ADD action and JSON configuration

func DelegateDel

func DelegateDel(delegatePlugin string, netconf []byte) error

DelegateDel calls the given delegate plugin with the CNI DEL action and JSON configuration

func DelegateGet

func DelegateGet(delegatePlugin string, netconf []byte) (types.Result, error)

DelegateGet calls the given delegate plugin with the CNI GET action and JSON configuration

func ExecPluginWithResult

func ExecPluginWithResult(pluginPath string, netconf []byte, args CNIArgs) (types.Result, error)

func ExecPluginWithoutResult

func ExecPluginWithoutResult(pluginPath string, netconf []byte, args CNIArgs) error

func FindInPath

func FindInPath(plugin string, paths []string) (string, error)

FindInPath returns the full path of the plugin by searching in the provided path

func GetVersionInfo added in v0.4.0

func GetVersionInfo(pluginPath string) (version.PluginInfo, error)

Types

type Args

type Args struct {
	Command       string
	ContainerID   string
	NetNS         string
	PluginArgs    [][2]string
	PluginArgsStr string
	IfName        string
	Path          string
}

func (*Args) AsEnv

func (args *Args) AsEnv() []string

type CNIArgs

type CNIArgs interface {
	// For use with os/exec; i.e., return nil to inherit the
	// environment from this process
	AsEnv() []string
}

func ArgsFromEnv

func ArgsFromEnv() CNIArgs

type PluginExec added in v0.4.0

type PluginExec struct {
	RawExec interface {
		ExecPlugin(pluginPath string, stdinData []byte, environ []string) ([]byte, error)
	}
	VersionDecoder interface {
		Decode(jsonBytes []byte) (version.PluginInfo, error)
	}
}

func (*PluginExec) GetVersionInfo added in v0.4.0

func (e *PluginExec) GetVersionInfo(pluginPath string) (version.PluginInfo, error)

GetVersionInfo returns the version information available about the plugin. For recent-enough plugins, it uses the information returned by the VERSION command. For older plugins which do not recognize that command, it reports version 0.1.0

func (*PluginExec) WithResult added in v0.4.0

func (e *PluginExec) WithResult(pluginPath string, netconf []byte, args CNIArgs) (types.Result, error)

func (*PluginExec) WithoutResult added in v0.4.0

func (e *PluginExec) WithoutResult(pluginPath string, netconf []byte, args CNIArgs) error

type RawExec added in v0.4.0

type RawExec struct {
	Stderr io.Writer
}

func (*RawExec) ExecPlugin added in v0.4.0

func (e *RawExec) ExecPlugin(pluginPath string, stdinData []byte, environ []string) ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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