package plugin
import "github.com/dotcloud/docker/plugin"
Index ¶
- type ErrAmbiguous
- type ErrNotFound
- type Manager
- func NewManager(config ManagerConfig) (*Manager, error)
- func (pm *Manager) CreateFromContext(ctx context.Context, tarCtx io.ReadCloser, options *types.PluginCreateOptions) error
- func (pm *Manager) Disable(name string, config *types.PluginDisableConfig) error
- func (pm *Manager) Enable(name string, config *types.PluginEnableConfig) error
- func (pm *Manager) GC()
- func (pm *Manager) Inspect(refOrID string) (tp *types.Plugin, err error)
- func (pm *Manager) List() ([]types.Plugin, error)
- func (pm *Manager) Privileges(ctx context.Context, ref reference.Named, metaHeader http.Header, authConfig *types.AuthConfig) (types.PluginPrivileges, error)
- func (pm *Manager) Pull(ctx context.Context, ref reference.Named, name string, metaHeader http.Header, authConfig *types.AuthConfig, privileges types.PluginPrivileges, out io.Writer) error
- func (pm *Manager) Push(ctx context.Context, name string, metaHeader http.Header, authConfig *types.AuthConfig, out io.Writer) error
- func (pm *Manager) Remove(name string, config *types.PluginRmConfig) error
- func (pm *Manager) Set(name string, args []string) error
- func (pm *Manager) StateChanged(id string, e libcontainerd.StateInfo) error
- type ManagerConfig
- type Store
- func NewStore(libRoot string) *Store
- func (ps *Store) Add(p *v2.Plugin) error
- func (ps *Store) CallHandler(p *v2.Plugin)
- func (ps *Store) Get(name, capability string, mode int) (plugingetter.CompatPlugin, error)
- func (ps *Store) GetAll() map[string]*v2.Plugin
- func (ps *Store) GetAllByCap(capability string) ([]plugingetter.CompatPlugin, error)
- func (ps *Store) GetAllManagedPluginsByCap(capability string) []plugingetter.CompatPlugin
- func (ps *Store) GetV2Plugin(refOrID string) (*v2.Plugin, error)
- func (ps *Store) Handle(capability string, callback func(string, *plugins.Client))
- func (ps *Store) Remove(p *v2.Plugin)
- func (ps *Store) SetAll(plugins map[string]*v2.Plugin)
- func (ps *Store) SetState(p *v2.Plugin, state bool)
- type WriteCommitCloser
Types ¶
type ErrAmbiguous ¶
type ErrAmbiguous string
ErrAmbiguous indicates that a plugin was not found locally.
func (ErrAmbiguous) Error ¶
func (name ErrAmbiguous) Error() string
type ErrNotFound ¶
type ErrNotFound string
ErrNotFound indicates that a plugin was not found locally.
func (ErrNotFound) Error ¶
func (name ErrNotFound) Error() string
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager controls the plugin subsystem.
func NewManager ¶
func NewManager(config ManagerConfig) (*Manager, error)
NewManager returns a new plugin manager.
func (*Manager) CreateFromContext ¶
func (pm *Manager) CreateFromContext(ctx context.Context, tarCtx io.ReadCloser, options *types.PluginCreateOptions) error
CreateFromContext creates a plugin from the given pluginDir which contains both the rootfs and the config.json and a repoName with optional tag.
func (*Manager) Disable ¶
func (pm *Manager) Disable(name string, config *types.PluginDisableConfig) error
Disable deactivates a plugin, which implies that they cannot be used by containers.
func (*Manager) Enable ¶
func (pm *Manager) Enable(name string, config *types.PluginEnableConfig) error
Enable activates a plugin, which implies that they are ready to be used by containers.
func (*Manager) GC ¶
func (pm *Manager) GC()
GC cleans up unrefrenced blobs. This is recommended to run in a goroutine
func (*Manager) Inspect ¶
Inspect examines a plugin config
func (*Manager) List ¶
List displays the list of plugins and associated metadata.
func (*Manager) Privileges ¶
func (pm *Manager) Privileges(ctx context.Context, ref reference.Named, metaHeader http.Header, authConfig *types.AuthConfig) (types.PluginPrivileges, error)
Privileges pulls a plugin config and computes the privileges required to install it.
func (*Manager) Pull ¶
func (pm *Manager) Pull(ctx context.Context, ref reference.Named, name string, metaHeader http.Header, authConfig *types.AuthConfig, privileges types.PluginPrivileges, out io.Writer) error
Pull pulls a plugin, check if the correct privileges are provided and install the plugin.
func (*Manager) Push ¶
func (pm *Manager) Push(ctx context.Context, name string, metaHeader http.Header, authConfig *types.AuthConfig, out io.Writer) error
Push pushes a plugin to the store.
func (*Manager) Remove ¶
func (pm *Manager) Remove(name string, config *types.PluginRmConfig) error
Remove deletes plugin's root directory.
func (*Manager) Set ¶
Set sets plugin args
func (*Manager) StateChanged ¶
func (pm *Manager) StateChanged(id string, e libcontainerd.StateInfo) error
StateChanged updates plugin internals using libcontainerd events.
type ManagerConfig ¶
type ManagerConfig struct { Store *Store // remove Executor libcontainerd.Remote RegistryService registry.Service LiveRestoreEnabled bool // TODO: remove LogPluginEvent eventLogger Root string ExecRoot string }
ManagerConfig defines configuration needed to start new manager.
type Store ¶
Store manages the plugin inventory in memory and on-disk
func NewStore ¶
NewStore creates a Store.
func (*Store) Add ¶
Add adds a plugin to memory and plugindb. An error will be returned if there is a collision.
func (*Store) CallHandler ¶
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 an enabled plugin matching the given name and capability.
func (*Store) GetAll ¶
GetAll retreives all plugins.
func (*Store) GetAllByCap ¶
func (ps *Store) GetAllByCap(capability string) ([]plugingetter.CompatPlugin, error)
GetAllByCap returns a list of enabled plugins matching the given capability.
func (*Store) GetAllManagedPluginsByCap ¶
func (ps *Store) GetAllManagedPluginsByCap(capability string) []plugingetter.CompatPlugin
GetAllManagedPluginsByCap returns a list of managed plugins matching the given capability.
func (*Store) GetV2Plugin ¶
GetV2Plugin retreives a plugin by name, id or partial ID.
func (*Store) Handle ¶
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 ¶
Remove removes a plugin from memory and plugindb.
func (*Store) SetAll ¶
SetAll initialized plugins during daemon restore.
func (*Store) SetState ¶
SetState sets the active state of the plugin and updates plugindb.
type WriteCommitCloser ¶
type WriteCommitCloser interface { io.WriteCloser Commit() (digest.Digest, error) }
WriteCommitCloser defines object that can be committed to blobstore.
Source Files ¶
backend_unsupported.go blobstore.go defs.go manager.go store.go
Directories ¶
Path | Synopsis |
---|---|
plugin/v2 |
- Version
- v1.13.0
- Published
- Jan 17, 2017
- Platform
- js/wasm
- Imports
- 30 packages
- Last checked
- 4 seconds ago –
Tools for package owners.