mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
26 lines
477 B
Go
26 lines
477 B
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
"net/url"
|
|
|
|
"github.com/moby/moby/api/types"
|
|
)
|
|
|
|
// PluginRemove removes a plugin
|
|
func (cli *Client) PluginRemove(ctx context.Context, name string, options types.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
|
|
}
|