config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: AGPL-3.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	NoneKey = ""

	CompressionFormatGZipKey          = "gzip"
	CompressionFormatParallelGZipKey  = "parallelgzip"
	CompressionFormatLZ4Key           = "lz4"
	CompressionFormatZStandardKey     = "zstandard"
	CompressionFormatBrotliKey        = "brotli"
	CompressionFormatBzip2Key         = "bzip2"
	CompressionFormatBzip2ParallelKey = "parallelbzip2"

	EncryptionFormatAgeKey = "age"
	EncryptionFormatPGPKey = "pgp"

	SignatureFormatMinisignKey = "minisign"
	SignatureFormatPGPKey      = "pgp"

	CompressionLevelFastestKey  = "fastest"
	CompressionLevelBalancedKey = "balanced"
	CompressionLevelSmallestKey = "smallest"

	HeaderEventTypeArchive = "archive"
	HeaderEventTypeDelete  = "delete"
	HeaderEventTypeMove    = "move"
	HeaderEventTypeRestore = "restore"
	HeaderEventTypeUpdate  = "update"

	FileSystemNameSTFS = "STFS"

	FileSystemCacheTypeMemory = "memory"
	FileSystemCacheTypeDir    = "dir"

	WriteCacheTypeMemory = "memory"
	WriteCacheTypeFile   = "file"

	MagneticTapeBlockSize = 512
)

Variables

View Source
var (
	ErrEncryptionFormatUnknown  = errors.New("encryption format unknown")
	ErrSignatureFormatUnknown   = errors.New("signature format unknown")
	ErrCompressionFormatUnknown = errors.New("compression format unknown")

	ErrEncryptionFormatUnsupported  = errors.New("encryption format unsupported")
	ErrSignatureFormatUnsupported   = errors.New("signature format unsupported")
	ErrCompressionFormatUnsupported = errors.New("compression format unsupported")

	ErrSignatureFormatRegularOnly = errors.New("signature format only supports regular files, not tape drives")
	ErrSignatureInvalid           = errors.New("signature invalid")
	ErrSignatureMissing           = errors.New("signature missing")

	ErrCompressionFormatRegularOnly              = errors.New("compression format only supports regular files, not tape drives")
	ErrCompressionFormatRequiresLargerRecordSize = errors.New("compression format requires larger record size")
	ErrCompressionLevelUnsupported               = errors.New("compression level unsupported")
	ErrCompressionLevelUnknown                   = errors.New("compression level unknown")

	ErrIdentityUnparsable  = errors.New("identity could not be parsed")
	ErrRecipientUnparsable = errors.New("recipient could not be parsed")

	ErrKeygenFormatUnsupported = errors.New("key generation for format unsupported")

	ErrTarHeaderMissing         = errors.New("tar header missing")
	ErrTarHeaderEmbeddedMissing = errors.New("embedded tar header missing")

	ErrTapeDrivesUnsupported = errors.New("system unsupported for tape drives")

	ErrSTFSVersionUnsupported = errors.New("STFS version unsupported")
	ErrSTFSActionUnsupported  = errors.New("STFS action unsupported")

	ErrNotImplemented = errors.New("not implemented")
	ErrIsDirectory    = errors.New("is a directory")
	ErrIsFile         = errors.New("is a file")

	ErrFileSystemCacheTypeUnsupported = errors.New("file system cache type unsupported")
	ErrFileSystemCacheTypeUnknown     = errors.New("file system cache type unknown")

	ErrWriteCacheTypeUnsupported = errors.New("write cache type unsupported")
	ErrWriteCacheTypeUnknown     = errors.New("write cache type unknown")

	ErrNoRootDirectory   = errors.New("root directory could not be found")
	ErrDirectoryNotEmpty = errors.New("directory not empty")
)

Functions

This section is empty.

Types

type BackendConfig

type BackendConfig struct {
	GetWriter   func() (DriveWriterConfig, error)
	CloseWriter func() error

	GetReader   func() (DriveReaderConfig, error)
	CloseReader func() error

	MagneticTapeIO MagneticTapeIO
}

type CryptoConfig

type CryptoConfig struct {
	Recipient interface{}
	Identity  interface{}
	Password  string
}

type DriveReaderConfig

type DriveReaderConfig struct {
	Drive          ReadSeekFder
	DriveIsRegular bool
}

type DriveWriterConfig

type DriveWriterConfig struct {
	Drive          io.Writer
	DriveIsRegular bool
}

type FileConfig

type FileConfig struct {
	GetFile func() (io.ReadSeekCloser, error)
	Info    fs.FileInfo
	Path    string
	Link    string
}
type Header struct {
	Record          int64
	Lastknownrecord int64
	Block           int64
	Lastknownblock  int64
	Deleted         int64
	Typeflag        int64
	Name            string
	Linkname        string
	Size            int64
	Mode            int64
	UID             int64
	Gid             int64
	Uname           string
	Gname           string
	Modtime         time.Time
	Accesstime      time.Time
	Changetime      time.Time
	Devmajor        int64
	Devminor        int64
	Paxrecords      string
	Format          int64
}

type HeaderEvent

type HeaderEvent struct {
	Type    string
	Indexed bool
	Header  *Header
}

type MagneticTapeIO

type MagneticTapeIO interface {
	GetCurrentRecordFromTape(fd uintptr) (int64, error)
	GoToEndOfTape(fd uintptr) error
	GoToNextFileOnTape(fd uintptr) error
	EjectTape(fd uintptr) error
	SeekToRecordOnTape(fd uintptr, record int32) error
}

type MetadataConfig

type MetadataConfig struct {
	Metadata MetadataPersister
}

type MetadataPersister

type MetadataPersister interface {
	UpsertHeader(ctx context.Context, dbhdr *Header, initializing bool) error
	UpdateHeaderMetadata(ctx context.Context, dbhdr *Header) error
	MoveHeader(ctx context.Context, oldName string, newName string, lastknownrecord, lastknownblock int64) error
	GetHeaders(ctx context.Context) ([]*Header, error)
	GetHeader(ctx context.Context, name string) (*Header, error)
	GetHeaderByLinkname(ctx context.Context, linkname string) (*Header, error)
	GetHeaderChildren(ctx context.Context, name string) ([]*Header, error)
	GetRootPath(ctx context.Context) (string, error)
	GetHeaderDirectChildren(ctx context.Context, name string, limit int) ([]*Header, error)
	DeleteHeader(ctx context.Context, name string, lastknownrecord, lastknownblock int64) (*Header, error)
	GetLastIndexedRecordAndBlock(ctx context.Context, recordSize int) (int64, int64, error)
	PurgeAllHeaders(ctx context.Context) error
}

type PasswordConfig

type PasswordConfig struct {
	Password string
}

type PipeConfig

type PipeConfig struct {
	Compression string
	Encryption  string
	Signature   string
	RecordSize  int
}

type ReadSeekFder

type ReadSeekFder interface {
	io.ReadSeeker
	Fd() uintptr
}

Jump to

Keyboard shortcuts

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