engines

package
v0.0.0-...-f28a401 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EngineKindS3     = "s3"
	EngineKindDocker = "docker"
	EngineKindDump   = "dump"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerVolumeUsage

type ContainerVolumeUsage struct {
	ContainerID   string
	ContainerName string
	MountPath     string
}

type Docker

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

func NewDocker

func NewDocker() (*Docker, error)

func (*Docker) Close

func (d *Docker) Close() error

func (*Docker) GetContainersByVolume

func (d *Docker) GetContainersByVolume(ctx context.Context, volumeName string) ([]ContainerVolumeUsage, error)

func (*Docker) GetVolumeByName

func (d *Docker) GetVolumeByName(ctx context.Context, name string) (*VolumeInfo, error)

func (*Docker) Kind

func (d *Docker) Kind() EngineKind

func (*Docker) ListVolumes

func (d *Docker) ListVolumes(ctx context.Context) ([]VolumeInfo, error)

func (*Docker) Pause

func (d *Docker) Pause(ctx context.Context, containerID string) error

func (*Docker) Unpause

func (d *Docker) Unpause(ctx context.Context, containerID string) error

func (*Docker) WaitForAllPaused

func (d *Docker) WaitForAllPaused(ctx context.Context, containers []ContainerVolumeUsage) error

func (*Docker) WaitForPaused

func (d *Docker) WaitForPaused(ctx context.Context, containerID string) error

type Dump

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

func NewDump

func NewDump() (*Dump, error)

func (*Dump) DumpMariaDB

func (d *Dump) DumpMariaDB(ctx context.Context, config MariaDBDumpConfig) (*exec.Cmd, error)

func (*Dump) Kind

func (d *Dump) Kind() EngineKind

type Engine

type Engine interface {
	Kind() EngineKind
}

type EngineKind

type EngineKind string

func (EngineKind) IsStorageEngine

func (k EngineKind) IsStorageEngine() bool

func (EngineKind) String

func (k EngineKind) String() string

type MariaDBDumpConfig

type MariaDBDumpConfig struct {
	Host       string
	Port       string
	User       string
	Password   string
	Database   string
	OutputFile string
}

type S3

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

func NewClient

func NewClient(ctx context.Context, s3Config S3Config) (*S3, error)

func (*S3) KeepMax

func (c *S3) KeepMax(ctx context.Context, d string, max int) error

func (*S3) Kind

func (s *S3) Kind() EngineKind

func (*S3) UploadFile

func (c *S3) UploadFile(ctx context.Context, s string, d string) error

type S3Config

type S3Config struct {
	Bucket            string `toml:"bucket" yaml:"bucket"`
	Region            string `toml:"region" yaml:"region"`
	AccessKey         string `toml:"access_key" yaml:"access_key"`
	SecretKey         string `toml:"secret_key" yaml:"secret_key"`
	Endpoint          string `toml:"endpoint" yaml:"endpoint"`
	ForcePathStyle    bool   `toml:"force-path" yaml:"force-path"`
	HostnameImmutable bool   `toml:"hostname-immutable" yaml:"hostname-immutable"`
}

type VolumeInfo

type VolumeInfo struct {
	Name       string
	MountPoint string
	Driver     string
	Containers []ContainerVolumeUsage
}

Jump to

Keyboard shortcuts

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