Files
moby/client/plugin_set.go
Austin Vazquez 909e32b27d client: refactor plugin api client functions to define options/results structs
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-22 13:45:03 +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, options.Args, nil)
defer ensureReaderClosed(resp)
return PluginSetResult{}, err
}