api/types/checkpoint: move checkpoint options to client

Move the option-types to the client and in some cases create a
copy for the backend. These types are used to construct query-
args, and not marshaled to JSON, and can be replaced with functional
options in the client.

The CreateOptions type was used both as options-struct for the client,
and as struct to marshal/unmarshal the request. For this type, a copy
is created in the Client and a new `checkpoint.CreateRequest` is added
in the API.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-09-05 00:53:57 +02:00
parent a45639af26
commit a8afc2c6fb
20 changed files with 120 additions and 86 deletions

View File

@@ -0,0 +1,8 @@
package checkpoint
// CreateRequest holds parameters to create a checkpoint from a container.
type CreateRequest struct {
CheckpointID string
CheckpointDir string
Exit bool
}

View File

@@ -1,19 +0,0 @@
package checkpoint
// CreateOptions holds parameters to create a checkpoint from a container.
type CreateOptions struct {
CheckpointID string
CheckpointDir string
Exit bool
}
// ListOptions holds parameters to list checkpoints for a container.
type ListOptions struct {
CheckpointDir string
}
// DeleteOptions holds parameters to delete a checkpoint from a container.
type DeleteOptions struct {
CheckpointID string
CheckpointDir string
}