client: consolidate node options with their methods

Move them together, as we did for most of the other options.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-10-24 13:03:21 +02:00
parent 832590155c
commit 875c577711
17 changed files with 42 additions and 52 deletions

View File

@@ -9,6 +9,9 @@ import (
"github.com/moby/moby/api/types/swarm"
)
// NodeInspectOptions holds parameters to inspect nodes with.
type NodeInspectOptions struct{}
type NodeInspectResult struct {
Node swarm.Node
Raw []byte

View File

@@ -8,6 +8,11 @@ import (
"github.com/moby/moby/api/types/swarm"
)
// NodeListOptions holds parameters to list nodes with.
type NodeListOptions struct {
Filters Filters
}
type NodeListResult struct {
Items []swarm.Node
}

View File

@@ -5,6 +5,10 @@ import (
"net/url"
)
// NodeRemoveOptions holds parameters to remove nodes with.
type NodeRemoveOptions struct {
Force bool
}
type NodeRemoveResult struct{}
// NodeRemove removes a Node.

View File

@@ -3,8 +3,16 @@ package client
import (
"context"
"net/url"
"github.com/moby/moby/api/types/swarm"
)
// NodeUpdateOptions holds parameters to update nodes with.
type NodeUpdateOptions struct {
Version swarm.Version
Node swarm.NodeSpec
}
type NodeUpdateResult struct{}
// NodeUpdate updates a Node.

View File

@@ -1,4 +0,0 @@
package client
// NodeInspectOptions holds parameters to inspect nodes with.
type NodeInspectOptions struct{}

View File

@@ -1,6 +0,0 @@
package client
// NodeListOptions holds parameters to list nodes with.
type NodeListOptions struct {
Filters Filters
}

View File

@@ -1,6 +0,0 @@
package client
// NodeRemoveOptions holds parameters to remove nodes with.
type NodeRemoveOptions struct {
Force bool
}

View File

@@ -1,9 +0,0 @@
package client
import "github.com/moby/moby/api/types/swarm"
// NodeUpdateOptions holds parameters to update nodes with.
type NodeUpdateOptions struct {
Version swarm.Version
Node swarm.NodeSpec
}