dockerbackup

package
v0.0.0-...-ddc95e7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient interface {
	Inspector
	Creator
	Starter
}

APIClient defines an interface for container operations including inspect, create, and start.

type BackupManager

type BackupManager struct {
	// contains filtered or unexported fields
}

BackupManager handles backup operations such as creating and inspecting container states.

func NewBackupManager

func NewBackupManager(cli APIClient, ctx context.Context) *BackupManager

NewBackupManager initializes and returns a new BackupManager with the provided APIClient and context.

func (*BackupManager) BackupVolume

func (bm *BackupManager) BackupVolume(container, volume, outputPath string) error

BackupVolume creates a backup of the specified volume in the given container and writes it to the specified output path.

type Creator

type Creator interface {
	ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *ocispec.Platform, containerName string) (container.CreateResponse, error)
}

The Creator defines an interface for creating Docker containers with the specified configurations and context.

type Inspector

type Inspector interface {
	ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)
}

The Inspector defines methods to inspect the state and details of a container using its container ID.

type Starter

type Starter interface {
	ContainerStart(ctx context.Context, containerID string, options container.StartOptions) error
}

Starter defines methods to start a container with given options in a specific context.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL