api/types: move SwarmUnlockKeyResponse to api/types/swarm

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-05-19 11:48:45 +02:00
parent f008d85edc
commit 7e8f630bec
7 changed files with 21 additions and 15 deletions

View File

@@ -4,18 +4,18 @@ import (
"context"
"encoding/json"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/swarm"
)
// SwarmGetUnlockKey retrieves the swarm's unlock key.
func (cli *Client) SwarmGetUnlockKey(ctx context.Context) (types.SwarmUnlockKeyResponse, error) {
func (cli *Client) SwarmGetUnlockKey(ctx context.Context) (swarm.UnlockKeyResponse, error) {
resp, err := cli.get(ctx, "/swarm/unlockkey", nil, nil)
defer ensureReaderClosed(resp)
if err != nil {
return types.SwarmUnlockKeyResponse{}, err
return swarm.UnlockKeyResponse{}, err
}
var response types.SwarmUnlockKeyResponse
var response swarm.UnlockKeyResponse
err = json.NewDecoder(resp.Body).Decode(&response)
return response, err
}