backup

package
v0.0.0-...-379a0d7 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RestoreTarGzBackup

func RestoreTarGzBackup(inPath string, outPath string) error

func VerifyBackup

func VerifyBackup(metadata BackupMetadata) error

Types

type BackupMetadata

type BackupMetadata struct {
	Date       time.Time `json:"timestamp"`
	FileFormat string    `json:"format"`
	FilePath   string    `json:"path"`
	Stores     []string  `json:"stores,omitempty"`
	Checksum   Checksum  `json:"checksum,omitempty"`
	Size       int64     `json:"size,omitempty"`
}

func NewTarGzBackup

func NewTarGzBackup(inPath string, outPath string, stores []string, extraData ...[]byte) (BackupMetadata, error)

func (BackupMetadata) Format

func (b BackupMetadata) Format() string

func (BackupMetadata) MarshalJSON

func (b BackupMetadata) MarshalJSON() ([]byte, error)

func (BackupMetadata) Path

func (b BackupMetadata) Path() string

func (BackupMetadata) Timestamp

func (b BackupMetadata) Timestamp() time.Time

func (BackupMetadata) Type

func (b BackupMetadata) Type() string

type Checksum

type Checksum struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type Format

type Format string
const (
	FormatTarGz Format = "tar.gz"
	FormatTar   Format = "tar"
	FormatZip   Format = "zip"
)

type TarGzBackup

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

func (*TarGzBackup) Format

func (tgz *TarGzBackup) Format() string

func (*TarGzBackup) Metadata

func (tgz *TarGzBackup) Metadata() BackupMetadata

Jump to

Keyboard shortcuts

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