Files
moby/client/config_remove.go
Sebastiaan van Stijn 2c5e0a008a client: rename ConfigListResult.Configs to ConfigListResult.Items
Also consolidate the options with the method.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-21 20:43:38 +02:00

26 lines
598 B
Go

package client
import "context"
type ConfigRemoveOptions struct {
// Add future optional parameters here
}
type ConfigRemoveResult struct {
// Add future fields here
}
// ConfigRemove removes a config.
func (cli *Client) ConfigRemove(ctx context.Context, id string, options ConfigRemoveOptions) (ConfigRemoveResult, error) {
id, err := trimID("config", id)
if err != nil {
return ConfigRemoveResult{}, err
}
resp, err := cli.delete(ctx, "/configs/"+id, nil, nil)
defer ensureReaderClosed(resp)
if err != nil {
return ConfigRemoveResult{}, err
}
return ConfigRemoveResult{}, nil
}