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>
27 lines
557 B
Go
27 lines
557 B
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
"net/url"
|
|
)
|
|
|
|
// PluginDisableOptions holds parameters to disable plugins.
|
|
type PluginDisableOptions struct {
|
|
Force bool
|
|
}
|
|
|
|
// PluginDisable disables a plugin
|
|
func (cli *Client) PluginDisable(ctx context.Context, name string, options PluginDisableOptions) error {
|
|
name, err := trimID("plugin", name)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
query := url.Values{}
|
|
if options.Force {
|
|
query.Set("force", "1")
|
|
}
|
|
resp, err := cli.post(ctx, "/plugins/"+name+"/disable", query, nil, nil)
|
|
ensureReaderClosed(resp)
|
|
return err
|
|
}
|