Most of the code in the filters package relates to the unmarshaling, validation and application of filters from client requests. None of this is necessary or particularly useful for Go SDK users. Move the full-fat filters package into daemon/internal and switch all the daemon code to import that package so we are free to iterate upon the code without worrying about source-code interface compatibility. Signed-off-by: Cory Snider <csnider@mirantis.com>
30 lines
1.4 KiB
Go
30 lines
1.4 KiB
Go
package plugin
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
"net/http"
|
|
|
|
"github.com/distribution/reference"
|
|
plugintypes "github.com/moby/moby/api/types/plugin"
|
|
"github.com/moby/moby/api/types/registry"
|
|
"github.com/moby/moby/v2/daemon/internal/filters"
|
|
"github.com/moby/moby/v2/daemon/pkg/plugin"
|
|
"github.com/moby/moby/v2/daemon/server/backend"
|
|
)
|
|
|
|
// Backend for Plugin
|
|
type Backend interface {
|
|
Disable(name string, config *backend.PluginDisableConfig) error
|
|
Enable(name string, config *backend.PluginEnableConfig) error
|
|
List(filters.Args) ([]plugintypes.Plugin, error)
|
|
Inspect(name string) (*plugintypes.Plugin, error)
|
|
Remove(name string, config *backend.PluginRmConfig) error
|
|
Set(name string, args []string) error
|
|
Privileges(ctx context.Context, ref reference.Named, metaHeaders http.Header, authConfig *registry.AuthConfig) (plugintypes.Privileges, error)
|
|
Pull(ctx context.Context, ref reference.Named, name string, metaHeaders http.Header, authConfig *registry.AuthConfig, privileges plugintypes.Privileges, outStream io.Writer, opts ...plugin.CreateOpt) error
|
|
Push(ctx context.Context, name string, metaHeaders http.Header, authConfig *registry.AuthConfig, outStream io.Writer) error
|
|
Upgrade(ctx context.Context, ref reference.Named, name string, metaHeaders http.Header, authConfig *registry.AuthConfig, privileges plugintypes.Privileges, outStream io.Writer) error
|
|
CreateFromContext(ctx context.Context, tarCtx io.ReadCloser, options *backend.PluginCreateConfig) error
|
|
}
|