plugin

package
v1.0.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2017 License: Apache-2.0, CC-BY-SA-4.0 Imports: 13 Imported by: 3,244

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoPluginType = errors.New("plugin: no type")
	ErrNoPluginID   = errors.New("plugin: no id")

	// SkipPlugin is used when a plugin is not initialized and should not be loaded,
	// this allows the plugin loader differentiate between a plugin which is configured
	// not to load and one that fails to load.
	SkipPlugin = errors.New("skip plugin")
)

Functions

func IsSkipPlugin

func IsSkipPlugin(err error) bool

IsSkipPlugin returns true if the error is skipping the plugin

func Load

func Load(path string) (err error)

Load loads all plugins at the provided path into containerd

func Register

func Register(r *Registration)

Types

type Differ

type Differ interface {
	Apply(ctx context.Context, desc ocispec.Descriptor, mount []mount.Mount) (ocispec.Descriptor, error)
	DiffMounts(ctx context.Context, lower, upper []mount.Mount, media, ref string) (ocispec.Descriptor, error)
}

type InitContext

type InitContext struct {
	Root    string
	Address string
	Context context.Context
	Config  interface{}
	Events  *events.Exchange
	// contains filtered or unexported fields
}

func NewContext

func NewContext(ctx context.Context, plugins map[PluginType]map[string]interface{}, root, id string) *InitContext

func (*InitContext) Get

func (i *InitContext) Get(t PluginType) (interface{}, error)

func (*InitContext) GetAll

func (i *InitContext) GetAll(t PluginType) (map[string]interface{}, error)

type PluginType

type PluginType string
const (
	RuntimePlugin     PluginType = "io.containerd.runtime.v1"
	GRPCPlugin        PluginType = "io.containerd.grpc.v1"
	SnapshotPlugin    PluginType = "io.containerd.snapshotter.v1"
	TaskMonitorPlugin PluginType = "io.containerd.monitor.v1"
	DiffPlugin        PluginType = "io.containerd.differ.v1"
	MetadataPlugin    PluginType = "io.containerd.metadata.v1"
	ContentPlugin     PluginType = "io.containerd.content.v1"
)

type Registration

type Registration struct {
	Type     PluginType
	ID       string
	Config   interface{}
	Requires []PluginType
	Init     func(*InitContext) (interface{}, error)
	// contains filtered or unexported fields
}

func Graph

func Graph() (ordered []*Registration)

func (*Registration) URI

func (r *Registration) URI() string

type Service

type Service interface {
	Register(*grpc.Server) error
}

Jump to

Keyboard shortcuts

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