backend_unsupported.go 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // +build !linux
  2. package plugin
  3. import (
  4. "errors"
  5. "io"
  6. "net/http"
  7. "github.com/docker/distribution/reference"
  8. "github.com/docker/docker/api/types"
  9. "github.com/docker/docker/api/types/filters"
  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, opts ...CreateOpt) error {
  31. return errNotSupported
  32. }
  33. // Upgrade pulls a plugin, check if the correct privileges are provided and install the plugin.
  34. func (pm *Manager) Upgrade(ctx context.Context, ref reference.Named, name string, metaHeader http.Header, authConfig *types.AuthConfig, privileges types.PluginPrivileges, outStream io.Writer) error {
  35. return errNotSupported
  36. }
  37. // List displays the list of plugins and associated metadata.
  38. func (pm *Manager) List(pluginFilters filters.Args) ([]types.Plugin, error) {
  39. return nil, errNotSupported
  40. }
  41. // Push pushes a plugin to the store.
  42. func (pm *Manager) Push(ctx context.Context, name string, metaHeader http.Header, authConfig *types.AuthConfig, out io.Writer) error {
  43. return errNotSupported
  44. }
  45. // Remove deletes plugin's root directory.
  46. func (pm *Manager) Remove(name string, config *types.PluginRmConfig) error {
  47. return errNotSupported
  48. }
  49. // Set sets plugin args
  50. func (pm *Manager) Set(name string, args []string) error {
  51. return errNotSupported
  52. }
  53. // CreateFromContext creates a plugin from the given pluginDir which contains
  54. // both the rootfs and the config.json and a repoName with optional tag.
  55. func (pm *Manager) CreateFromContext(ctx context.Context, tarCtx io.ReadCloser, options *types.PluginCreateOptions) error {
  56. return errNotSupported
  57. }