github.com/Heebron/moby@v0.0.0-20221111184709-6eab4f55faf7/client/node_remove.go (about) 1 package client // import "github.com/docker/docker/client" 2 3 import ( 4 "context" 5 "net/url" 6 7 "github.com/docker/docker/api/types" 8 ) 9 10 // NodeRemove removes a Node. 11 func (cli *Client) NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error { 12 query := url.Values{} 13 if options.Force { 14 query.Set("force", "1") 15 } 16 17 resp, err := cli.delete(ctx, "/nodes/"+nodeID, query, nil) 18 defer ensureReaderClosed(resp) 19 return err 20 }