testing

package
v0.0.0-...-c5633df Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FinishMetadata

func FinishMetadata(meta *backups.Metadata)

FinishMetadata finishes a metadata with test values.

func NewArchive

func NewArchive(meta *backups.Metadata, files, dump []File) (*bytes.Buffer, error)

NewArchive returns a new archive file containing the files.

func NewArchiveBasic

func NewArchiveBasic(meta *backups.Metadata) (*bytes.Buffer, error)

NewArchiveBasic returns a new archive file with a few files provided.

func NewArchiveV0

func NewArchiveV0(meta *backups.Metadata, files, dump []File) (*bytes.Buffer, error)

NewArchiveV0 returns a new archive file containing the files, in v0 format.

func NewMetadata

func NewMetadata() *backups.Metadata

NewMetadata returns a Metadata to use for testing.

func NewMetadataStarted

func NewMetadataStarted() *backups.Metadata

NewMetadataStarted returns a Metadata to use for testing.

func SetOrigin

func SetOrigin(meta *backups.Metadata, modelUUID, machine, hostname string)

SetOrigin updates the metadata's origin with the privided information.

func UpdateNotes

func UpdateNotes(meta *backups.Metadata, notes string) *backups.Metadata

UpdateNotes derives a new Metadata with new notes.

Types

type File

type File struct {
	// Name is the path to which the file will be identified in the archive.
	Name string
	// Content is the data that will be written to the archive for the file.
	Content string
	// IsDir determines if the file is a regular file or a directory.
	IsDir bool
}

File represents a file during testing.

func (*File) AddToArchive

func (f *File) AddToArchive(archive *tar.Writer) error

AddToArchive adds the file to the tar archive.

Jump to

Keyboard shortcuts

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