backend_unsupported.go 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // +build !linux
  2. package plugin
  3. import (
  4. "errors"
  5. "io"
  6. "net/http"
  7. "github.com/docker/docker/api/types"
  8. "github.com/docker/docker/api/types/filters"
  9. "github.com/docker/docker/reference"
  10. "golang.org/x/net/context"
  11. )
  12. var errNotSupported = errors.New("plugins are not supported on this platform")
  13. // Disable deactivates a plugin, which implies that they cannot be used by containers.
  14. func (pm *Manager) Disable(name string, config *types.PluginDisableConfig) error {
  15. return errNotSupported
  16. }
  17. // Enable activates a plugin, which implies that they are ready to be used by containers.
  18. func (pm *Manager) Enable(name string, config *types.PluginEnableConfig) error {
  19. return errNotSupported
  20. }
  21. // Inspect examines a plugin config
  22. func (pm *Manager) Inspect(refOrID string) (tp *types.Plugin, err error) {
  23. return nil, errNotSupported
  24. }
  25. // Privileges pulls a plugin config and computes the privileges required to install it.
  26. func (pm *Manager) Privileges(ctx context.Context, ref reference.Named, metaHeader http.Header, authConfig *types.AuthConfig) (types.PluginPrivileges, error) {
  27. return nil, errNotSupported
  28. }
  29. // Pull pulls a plugin, check if the correct privileges are provided and install the plugin.
  30. 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 {
  31. return errNotSupported
  32. }
  33. // List displays the list of plugins and associated metadata.
  34. func (pm *Manager) List(pluginFilters filters.Args) ([]types.Plugin, error) {
  35. return nil, errNotSupported
  36. }
  37. // Push pushes a plugin to the store.
  38. func (pm *Manager) Push(ctx context.Context, name string, metaHeader http.Header, authConfig *types.AuthConfig, out io.Writer) error {
  39. return errNotSupported
  40. }
  41. // Remove deletes plugin's root directory.
  42. func (pm *Manager) Remove(name string, config *types.PluginRmConfig) error {
  43. return errNotSupported
  44. }
  45. // Set sets plugin args
  46. func (pm *Manager) Set(name string, args []string) error {
  47. return errNotSupported
  48. }
  49. // CreateFromContext creates a plugin from the given pluginDir which contains
  50. // both the rootfs and the config.json and a repoName with optional tag.
  51. func (pm *Manager) CreateFromContext(ctx context.Context, tarCtx io.ReadCloser, options *types.PluginCreateOptions) error {
  52. return errNotSupported
  53. }