backend.go 1.4 KB

12345678910111213141516171819202122232425262728
  1. package plugin // import "github.com/docker/docker/api/server/router/plugin"
  2. import (
  3. "context"
  4. "io"
  5. "net/http"
  6. "github.com/distribution/reference"
  7. "github.com/docker/docker/api/types"
  8. "github.com/docker/docker/api/types/filters"
  9. "github.com/docker/docker/api/types/registry"
  10. "github.com/docker/docker/plugin"
  11. )
  12. // Backend for Plugin
  13. type Backend interface {
  14. Disable(name string, config *types.PluginDisableConfig) error
  15. Enable(name string, config *types.PluginEnableConfig) error
  16. List(filters.Args) ([]types.Plugin, error)
  17. Inspect(name string) (*types.Plugin, error)
  18. Remove(name string, config *types.PluginRmConfig) error
  19. Set(name string, args []string) error
  20. Privileges(ctx context.Context, ref reference.Named, metaHeaders http.Header, authConfig *registry.AuthConfig) (types.PluginPrivileges, error)
  21. Pull(ctx context.Context, ref reference.Named, name string, metaHeaders http.Header, authConfig *registry.AuthConfig, privileges types.PluginPrivileges, outStream io.Writer, opts ...plugin.CreateOpt) error
  22. Push(ctx context.Context, name string, metaHeaders http.Header, authConfig *registry.AuthConfig, outStream io.Writer) error
  23. Upgrade(ctx context.Context, ref reference.Named, name string, metaHeaders http.Header, authConfig *registry.AuthConfig, privileges types.PluginPrivileges, outStream io.Writer) error
  24. CreateFromContext(ctx context.Context, tarCtx io.ReadCloser, options *types.PluginCreateOptions) error
  25. }