mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
These types are only consumed by the client, not the daemon. Signed-off-by: Cory Snider <csnider@mirantis.com>
29 lines
544 B
Go
29 lines
544 B
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
"net/url"
|
|
)
|
|
|
|
// PluginRemoveOptions holds parameters to remove plugins.
|
|
type PluginRemoveOptions struct {
|
|
Force bool
|
|
}
|
|
|
|
// PluginRemove removes a plugin
|
|
func (cli *Client) PluginRemove(ctx context.Context, name string, options PluginRemoveOptions) error {
|
|
name, err := trimID("plugin", name)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
query := url.Values{}
|
|
if options.Force {
|
|
query.Set("force", "1")
|
|
}
|
|
|
|
resp, err := cli.delete(ctx, "/plugins/"+name, query, nil)
|
|
defer ensureReaderClosed(resp)
|
|
return err
|
|
}
|