backend_unsupported.go 2.2 KB

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