package invoke
import "github.com/containernetworking/cni/pkg/invoke"
Index ¶
- func DelegateAdd(delegatePlugin string, netconf []byte) (types.Result, error)
- func DelegateDel(delegatePlugin string, netconf []byte) error
- func ExecPluginWithResult(pluginPath string, netconf []byte, args CNIArgs) (types.Result, error)
- func ExecPluginWithoutResult(pluginPath string, netconf []byte, args CNIArgs) error
- func FindInPath(plugin string, paths []string) (string, error)
- func GetVersionInfo(pluginPath string) (version.PluginInfo, error)
- type Args
- type CNIArgs
- type PluginExec
- func (e *PluginExec) GetVersionInfo(pluginPath string) (version.PluginInfo, error)
- func (e *PluginExec) WithResult(pluginPath string, netconf []byte, args CNIArgs) (types.Result, error)
- func (e *PluginExec) WithoutResult(pluginPath string, netconf []byte, args CNIArgs) error
- type RawExec
Functions ¶
func DelegateAdd ¶
func DelegateDel ¶
func ExecPluginWithResult ¶
func ExecPluginWithoutResult ¶
func FindInPath ¶
FindInPath returns the full path of the plugin by searching in the provided path
func GetVersionInfo ¶
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 ¶
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 ¶
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 ¶
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 ¶
func (e *PluginExec) WithResult(pluginPath string, netconf []byte, args CNIArgs) (types.Result, error)
func (*PluginExec) WithoutResult ¶
func (e *PluginExec) WithoutResult(pluginPath string, netconf []byte, args CNIArgs) error
type RawExec ¶
func (*RawExec) ExecPlugin ¶
Source Files ¶
args.go delegate.go exec.go find.go raw_exec.go
Directories ¶
| Path | Synopsis |
|---|---|
| pkg/invoke/fakes |
- Version
- v0.5.0-rc1
- Published
- Mar 2, 2017
- Platform
- js/wasm
- Imports
- 10 packages
- Last checked
- 3 days ago –
Tools for package owners.