mirror of
https://github.com/moby/moby.git
synced 2026-01-11 02:31:44 +00:00
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
27 lines
801 B
Go
27 lines
801 B
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// NetworkRemoveOptions specifies options for removing a network.
|
|
type NetworkRemoveOptions struct {
|
|
// No options currently; placeholder for future use.
|
|
}
|
|
|
|
// NetworkRemoveResult represents the result of a network removal operation.
|
|
type NetworkRemoveResult struct {
|
|
// No fields currently; placeholder for future use.
|
|
}
|
|
|
|
// NetworkRemove removes an existent network from the docker host.
|
|
func (cli *Client) NetworkRemove(ctx context.Context, networkID string, options NetworkRemoveOptions) (NetworkRemoveResult, error) {
|
|
networkID, err := trimID("network", networkID)
|
|
if err != nil {
|
|
return NetworkRemoveResult{}, err
|
|
}
|
|
resp, err := cli.delete(ctx, "/networks/"+networkID, nil, nil)
|
|
defer ensureReaderClosed(resp)
|
|
return NetworkRemoveResult{}, err
|
|
}
|