store

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 ErrNotFound

type ErrNotFound string

ErrNotFound indicates that a plugin was not found locally.

func (ErrNotFound) Error

func (name ErrNotFound) Error() string

type Store

type Store struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Store manages the plugin inventory in memory and on-disk

func NewStore

func NewStore(libRoot string) *Store

NewStore creates a Store.

func (*Store) Add

func (ps *Store) Add(p *v2.Plugin)

Add adds a plugin to memory and plugindb.

func (*Store) CallHandler

func (ps *Store) CallHandler(p *v2.Plugin)

CallHandler calls the registered callback. It is invoked during plugin enable.

func (*Store) Get

func (ps *Store) Get(name, capability string, mode int) (plugingetter.CompatPlugin, error)

Get returns a plugin matching the given name and capability.

func (*Store) GetAll

func (ps *Store) GetAll() map[string]*v2.Plugin

GetAll retreives all plugins.

func (*Store) GetAllByCap

func (ps *Store) GetAllByCap(capability string) ([]plugingetter.CompatPlugin, error)

GetAllByCap returns a list of plugins matching the given capability.

func (*Store) GetByID

func (ps *Store) GetByID(id string) (*v2.Plugin, error)

GetByID retreives a plugin by ID.

func (*Store) GetByName

func (ps *Store) GetByName(name string) (*v2.Plugin, error)

GetByName retreives a plugin by name.

func (*Store) Handle

func (ps *Store) Handle(capability string, callback func(string, *plugins.Client))

Handle sets a callback for a given capability. It is only used by network and ipam drivers during plugin registration. The callback registers the driver with the subsystem (network, ipam).

func (*Store) Remove

func (ps *Store) Remove(p *v2.Plugin)

Remove removes a plugin from memory and plugindb.

func (*Store) SetAll

func (ps *Store) SetAll(plugins map[string]*v2.Plugin)

SetAll initialized plugins during daemon restore.

func (*Store) SetState

func (ps *Store) SetState(p *v2.Plugin, state bool)

SetState sets the active state of the plugin and updates plugindb.

Jump to

Keyboard shortcuts

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