backend.go 1.5 KB

1234567891011121314151617181920212223242526272829
  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/backend"
  9. "github.com/docker/docker/api/types/filters"
  10. "github.com/docker/docker/api/types/registry"
  11. "github.com/docker/docker/plugin"
  12. )
  13. // Backend for Plugin
  14. type Backend interface {
  15. Disable(name string, config *backend.PluginDisableConfig) error
  16. Enable(name string, config *backend.PluginEnableConfig) error
  17. List(filters.Args) ([]types.Plugin, error)
  18. Inspect(name string) (*types.Plugin, error)
  19. Remove(name string, config *backend.PluginRmConfig) error
  20. Set(name string, args []string) error
  21. Privileges(ctx context.Context, ref reference.Named, metaHeaders http.Header, authConfig *registry.AuthConfig) (types.PluginPrivileges, error)
  22. 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
  23. Push(ctx context.Context, name string, metaHeaders http.Header, authConfig *registry.AuthConfig, outStream io.Writer) error
  24. Upgrade(ctx context.Context, ref reference.Named, name string, metaHeaders http.Header, authConfig *registry.AuthConfig, privileges types.PluginPrivileges, outStream io.Writer) error
  25. CreateFromContext(ctx context.Context, tarCtx io.ReadCloser, options *types.PluginCreateOptions) error
  26. }