Files
moby/client/plugin_set.go
Sebastiaan van Stijn b20c3db932 client: request: use consistent order or arguments
Make `body` the last argument, so that requests can be inlined on call-sites.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-08-29 14:14:26 +02:00

28 lines
724 B
Go

package client
import (
"context"
)
// PluginSetOptions defines options for modifying a plugin's settings.
type PluginSetOptions struct {
Args []string
}
// PluginSetResult represents the result of a plugin set operation.
type PluginSetResult struct {
// Currently empty; can be extended in the future if needed.
}
// PluginSet modifies settings for an existing plugin
func (cli *Client) PluginSet(ctx context.Context, name string, options PluginSetOptions) (PluginSetResult, error) {
name, err := trimID("plugin", name)
if err != nil {
return PluginSetResult{}, err
}
resp, err := cli.post(ctx, "/plugins/"+name+"/set", nil, nil, options.Args)
defer ensureReaderClosed(resp)
return PluginSetResult{}, err
}