{"modulePath":"github.com/agilebits/moby","version":"v1.13.0","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package plugin\n\n## Types\n\n```go\ntype ErrAmbiguous string\n```\nErrAmbiguous indicates that a plugin was not found locally.\n\n```go\nfunc (name ErrAmbiguous) Error() string\n```\n\n```go\ntype ErrNotFound string\n```\nErrNotFound indicates that a plugin was not found locally.\n\n```go\nfunc (name ErrNotFound) Error() string\n```\n\n```go\ntype Manager struct {\n\t// contains filtered or unexported fields\n}\n```\nManager controls the plugin subsystem.\n\n```go\nfunc NewManager(config ManagerConfig) (*Manager, error)\n```\nNewManager returns a new plugin manager.\n\n```go\nfunc (pm *Manager) CreateFromContext(ctx context.Context, tarCtx io.ReadCloser, options *types.PluginCreateOptions) (err error)\n```\nCreateFromContext creates a plugin from the given pluginDir which contains both the rootfs and the config.json and a repoName with optional tag.\n\n```go\nfunc (pm *Manager) Disable(refOrID string, config *types.PluginDisableConfig) error\n```\nDisable deactivates a plugin. This means resources (volumes, networks) cant use them.\n\n```go\nfunc (pm *Manager) Enable(refOrID string, config *types.PluginEnableConfig) error\n```\nEnable activates a plugin, which implies that they are ready to be used by containers.\n\n```go\nfunc (pm *Manager) GC()\n```\nGC cleans up unrefrenced blobs. This is recommended to run in a goroutine\n\n```go\nfunc (pm *Manager) Inspect(refOrID string) (tp *types.Plugin, err error)\n```\nInspect examines a plugin config\n\n```go\nfunc (pm *Manager) List() ([]types.Plugin, error)\n```\nList displays the list of plugins and associated metadata.\n\n```go\nfunc (pm *Manager) Privileges(ctx context.Context, ref reference.Named, metaHeader http.Header, authConfig *types.AuthConfig) (types.PluginPrivileges, error)\n```\nPrivileges pulls a plugin config and computes the privileges required to install it.\n\n```go\nfunc (pm *Manager) Pull(ctx context.Context, ref reference.Named, name string, metaHeader http.Header, authConfig *types.AuthConfig, privileges types.PluginPrivileges, outStream io.Writer) (err error)\n```\nPull pulls a plugin, check if the correct privileges are provided and install the plugin.\n\n```go\nfunc (pm *Manager) Push(ctx context.Context, name string, metaHeader http.Header, authConfig *types.AuthConfig, outStream io.Writer) error\n```\nPush pushes a plugin to the store.\n\n```go\nfunc (pm *Manager) Remove(name string, config *types.PluginRmConfig) error\n```\nRemove deletes plugin's root directory.\n\n```go\nfunc (pm *Manager) Set(name string, args []string) error\n```\nSet sets plugin args\n\n```go\nfunc (pm *Manager) Shutdown()\n```\nShutdown stops all plugins and called during daemon shutdown.\n\n```go\nfunc (pm *Manager) StateChanged(id string, e libcontainerd.StateInfo) error\n```\nStateChanged updates plugin internals using libcontainerd events.\n\n```go\ntype ManagerConfig struct {\n\tStore              *Store // remove\n\tExecutor           libcontainerd.Remote\n\tRegistryService    registry.Service\n\tLiveRestoreEnabled bool // TODO: remove\n\tLogPluginEvent     eventLogger\n\tRoot               string\n\tExecRoot           string\n}\n```\nManagerConfig defines configuration needed to start new manager.\n\n```go\ntype Store struct {\n\tsync.RWMutex\n\t// contains filtered or unexported fields\n}\n```\nStore manages the plugin inventory in memory and on-disk\n\n```go\nfunc NewStore(libRoot string) *Store\n```\nNewStore creates a Store.\n\n```go\nfunc (ps *Store) Add(p *v2.Plugin) error\n```\nAdd adds a plugin to memory and plugindb. An error will be returned if there is a collision.\n\n```go\nfunc (ps *Store) CallHandler(p *v2.Plugin)\n```\nCallHandler calls the registered callback. It is invoked during plugin enable.\n\n```go\nfunc (ps *Store) Get(name, capability string, mode int) (plugingetter.CompatPlugin, error)\n```\nGet returns an enabled plugin matching the given name and capability.\n\n```go\nfunc (ps *Store) GetAll() map[string]*v2.Plugin\n```\nGetAll retreives all plugins.\n\n```go\nfunc (ps *Store) GetAllByCap(capability string) ([]plugingetter.CompatPlugin, error)\n```\nGetAllByCap returns a list of enabled plugins matching the given capability.\n\n```go\nfunc (ps *Store) GetAllManagedPluginsByCap(capability string) []plugingetter.CompatPlugin\n```\nGetAllManagedPluginsByCap returns a list of managed plugins matching the given capability.\n\n```go\nfunc (ps *Store) GetV2Plugin(refOrID string) (*v2.Plugin, error)\n```\nGetV2Plugin retreives a plugin by name, id or partial ID.\n\n```go\nfunc (ps *Store) Handle(capability string, callback func(string, *plugins.Client))\n```\nHandle 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).\n\n```go\nfunc (ps *Store) Remove(p *v2.Plugin)\n```\nRemove removes a plugin from memory and plugindb.\n\n```go\nfunc (ps *Store) SetAll(plugins map[string]*v2.Plugin)\n```\nSetAll initialized plugins during daemon restore.\n\n```go\nfunc (ps *Store) SetState(p *v2.Plugin, state bool)\n```\nSetState sets the active state of the plugin and updates plugindb.\n\n```go\ntype WriteCommitCloser interface {\n\tio.WriteCloser\n\tCommit() (digest.Digest, error)\n}\n```\nWriteCommitCloser defines object that can be committed to blobstore.\n\n","path":"github.com/agilebits/moby/plugin","name":"plugin","synopsis":"","isRedistributable":true}
