backup

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: MIT Imports: 15 Imported by: 0

README

backup

func RestoreTarGzBackup
func RestoreTarGzBackup(inPath string, outPath string) error
func VerifyBackup
func VerifyBackup(metadata BackupMetadata) error
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 (bm BackupMetadata) Format() string
func (BackupMetadata) MarshalJSON
func (bm BackupMetadata) MarshalJSON() ([]byte, error)
func (BackupMetadata) Path
func (bm BackupMetadata) Path() string
func (BackupMetadata) Timestamp
func (bm BackupMetadata) Timestamp() time.Time
func (BackupMetadata) Type
func (bm 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 {
}
func (*TarGzBackup) Format
func (tgz *TarGzBackup) Format() string
func (*TarGzBackup) Metadata
func (tgz *TarGzBackup) Metadata() BackupMetadata

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RestoreTarGzBackup added in v0.4.2

func RestoreTarGzBackup(inPath string, outPath string) error

func VerifyBackup added in v0.4.2

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 (bm BackupMetadata) Format() string

func (BackupMetadata) MarshalJSON added in v0.4.2

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

func (BackupMetadata) Path

func (bm BackupMetadata) Path() string

func (BackupMetadata) Timestamp

func (bm BackupMetadata) Timestamp() time.Time

func (BackupMetadata) Type added in v0.4.2

func (bm 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