v2

package
v1.13.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrInadequateCapability

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

ErrInadequateCapability indicates that the plugin did not have the requested capability.

func (ErrInadequateCapability) Error

func (e ErrInadequateCapability) Error() string

type Plugin

type Plugin struct {
	sync.RWMutex
	PluginObj         types.Plugin    `json:"plugin"`
	PClient           *plugins.Client `json:"-"`
	RuntimeSourcePath string          `json:"-"`
	RefCount          int             `json:"-"`
	Restart           bool            `json:"-"`
	ExitChan          chan bool       `json:"-"`
	LibRoot           string          `json:"-"`
}

Plugin represents an individual plugin.

func NewPlugin

func NewPlugin(name, id, runRoot, libRoot, tag string) *Plugin

NewPlugin creates a plugin.

func (*Plugin) Client

func (p *Plugin) Client() *plugins.Client

Client returns the plugin client.

func (*Plugin) ComputePrivileges

func (p *Plugin) ComputePrivileges() types.PluginPrivileges

ComputePrivileges takes the config file and computes the list of access necessary for the plugin on the host.

func (*Plugin) FilterByCap

func (p *Plugin) FilterByCap(capability string) (*Plugin, error)

FilterByCap query the plugin for a given capability.

func (*Plugin) GetID

func (p *Plugin) GetID() string

GetID returns the plugin's ID.

func (*Plugin) GetSocket

func (p *Plugin) GetSocket() string

GetSocket returns the plugin socket.

func (*Plugin) GetTypes

func (p *Plugin) GetTypes() []types.PluginInterfaceType

GetTypes returns the interface types of a plugin.

func (*Plugin) InitPlugin

func (p *Plugin) InitPlugin() error

InitPlugin populates the plugin object from the plugin config file.

func (*Plugin) InitSpec

func (p *Plugin) InitSpec(s specs.Spec, libRoot string) (*specs.Spec, error)

InitSpec creates an OCI spec from the plugin's config.

func (*Plugin) IsEnabled

func (p *Plugin) IsEnabled() bool

IsEnabled returns the active state of the plugin.

func (*Plugin) IsV1

func (p *Plugin) IsV1() bool

IsV1 returns true for V1 plugins and false otherwise.

func (*Plugin) Name

func (p *Plugin) Name() string

Name returns the plugin name.

func (*Plugin) RemoveFromDisk

func (p *Plugin) RemoveFromDisk() error

RemoveFromDisk deletes the plugin's runtime files from disk.

func (*Plugin) Set

func (p *Plugin) Set(args []string) error

Set is used to pass arguments to the plugin.

Jump to

Keyboard shortcuts

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