Documentation ¶
Index ¶
- Constants
- Variables
- func AssertReaderIsEmpty(t *testing.T, reader io.Reader)
- func Contains(s *[]string, e string) bool
- func CreateMockStorageFolder() storage.Folder
- func CreateTar(w io.Writer, r *io.LimitedReader)
- func CreateWalPageWithContinuation() []byte
- func GetXLogRecordData() (walparser.XLogRecord, []byte)
- func MakeDefaultInMemoryStorageFolder() *memory.Folder
- func MakeDefaultUploader(uploaderAPI s3manageriface.UploaderAPI) *s3.Uploader
- func NewMockS3Client(err, notFound bool) *mockS3Client
- func NewMockS3Uploader(multiErr, err bool, storage *memory.Storage) *mockS3Uploader
- func NewMockUploader(apiMultiErr, apiErr bool) *internal.Uploader
- func NewStoringMockUploader(storage *memory.Storage, deltaDataFolder internal.DataFolder) *internal.Uploader
- type BackupFileListBuilder
- func (listBuilder BackupFileListBuilder) Build() internal.BackupFileList
- func (listBuilder BackupFileListBuilder) WithIncremented() BackupFileListBuilder
- func (listBuilder BackupFileListBuilder) WithSimple() BackupFileListBuilder
- func (listBuilder BackupFileListBuilder) WithSkipped() BackupFileListBuilder
- type BufCloser
- type BufferTarBall
- func (tarBall *BufferTarBall) AddSize(add int64)
- func (tarBall *BufferTarBall) AwaitUploads()
- func (tarBall *BufferTarBall) CloseTar() error
- func (tarBall *BufferTarBall) SetUp(crypter crypto.Crypter, args ...string)
- func (tarBall *BufferTarBall) Size() int64
- func (tarBall *BufferTarBall) TarWriter() *tar.Writer
- type BufferTarBallMaker
- type BufferTarInterpreter
- type ErrorReader
- type ErrorWriteCloser
- type ErrorWriter
- type FileReaderMaker
- type FileTarBall
- func (tarBall *FileTarBall) AddSize(i int64)
- func (tarBall *FileTarBall) AwaitUploads()
- func (tarBall *FileTarBall) CloseTar() error
- func (tarBall *FileTarBall) SetUp(crypter crypto.Crypter, names ...string)
- func (tarBall *FileTarBall) Size() int64
- func (tarBall *FileTarBall) TarWriter() *tar.Writer
- type FileTarBallMaker
- type MockCompressor
- type MockDataFolder
- func (folder *MockDataFolder) CleanFolder() error
- func (folder *MockDataFolder) CreateFile(filename string) error
- func (folder *MockDataFolder) DeleteFile(filename string) error
- func (folder *MockDataFolder) FileExists(filename string) bool
- func (folder *MockDataFolder) IsEmpty() bool
- func (folder *MockDataFolder) OpenReadonlyFile(filename string) (io.ReadCloser, error)
- func (folder *MockDataFolder) OpenWriteOnlyFile(filename string) (io.WriteCloser, error)
- type MockReadWriteCloser
- type NOPTarInterpreter
- type NopCloser
- type NopCloserWriter
- type NopSeeker
- type ReadWriteNopCloser
- type StrideByteReader
Constants ¶
const ( SimplePath = "/simple" SkippedPath = "/skipped" IncrementedPath = "/incremented" )
Variables ¶
var IncrementedDescription = *internal.NewBackupFileDescription(true, false, time.Time{})
var MockCloseError = errors.New("mock close: close error")
var MockReadError = errors.New("mock reader: read error")
var MockWriteError = errors.New("mock writer: write error")
var SimpleDescription = *internal.NewBackupFileDescription(false, false, time.Time{})
var SkippedDescription = *internal.NewBackupFileDescription(false, true, time.Time{})
Functions ¶
func CreateMockStorageFolder ¶ added in v0.2.10
func CreateTar ¶
func CreateTar(w io.Writer, r *io.LimitedReader)
CreateTar creates a new tarball from the passed in reader and writes to a destination writer.
func CreateWalPageWithContinuation ¶ added in v0.2.10
func CreateWalPageWithContinuation() []byte
func GetXLogRecordData ¶ added in v0.2.10
func GetXLogRecordData() (walparser.XLogRecord, []byte)
func MakeDefaultInMemoryStorageFolder ¶ added in v0.2.1
func MakeDefaultUploader ¶ added in v0.2.1
func MakeDefaultUploader(uploaderAPI s3manageriface.UploaderAPI) *s3.Uploader
func NewMockS3Client ¶
func NewMockS3Client(err, notFound bool) *mockS3Client
func NewMockS3Uploader ¶
func NewMockUploader ¶
func NewStoringMockUploader ¶
Types ¶
type BackupFileListBuilder ¶ added in v0.2.10
type BackupFileListBuilder struct {
// contains filtered or unexported fields
}
func NewBackupFileListBuilder ¶ added in v0.2.10
func NewBackupFileListBuilder() BackupFileListBuilder
func (BackupFileListBuilder) Build ¶ added in v0.2.10
func (listBuilder BackupFileListBuilder) Build() internal.BackupFileList
func (BackupFileListBuilder) WithIncremented ¶ added in v0.2.10
func (listBuilder BackupFileListBuilder) WithIncremented() BackupFileListBuilder
func (BackupFileListBuilder) WithSimple ¶ added in v0.2.10
func (listBuilder BackupFileListBuilder) WithSimple() BackupFileListBuilder
func (BackupFileListBuilder) WithSkipped ¶ added in v0.2.10
func (listBuilder BackupFileListBuilder) WithSkipped() BackupFileListBuilder
type BufferTarBall ¶
type BufferTarBall struct {
// contains filtered or unexported fields
}
BufferTarBall represents a tarball that is written to buffer.
func (*BufferTarBall) AddSize ¶
func (tarBall *BufferTarBall) AddSize(add int64)
func (*BufferTarBall) AwaitUploads ¶
func (tarBall *BufferTarBall) AwaitUploads()
func (*BufferTarBall) CloseTar ¶
func (tarBall *BufferTarBall) CloseTar() error
func (*BufferTarBall) SetUp ¶
func (tarBall *BufferTarBall) SetUp(crypter crypto.Crypter, args ...string)
func (*BufferTarBall) Size ¶
func (tarBall *BufferTarBall) Size() int64
func (*BufferTarBall) TarWriter ¶
func (tarBall *BufferTarBall) TarWriter() *tar.Writer
type BufferTarBallMaker ¶
type BufferTarInterpreter ¶
type BufferTarInterpreter struct {
Out []byte
}
BufferTarInterpreter extracts data to a byte slice. Used for testing purposes.
type ErrorReader ¶ added in v0.2.10
type ErrorReader struct{}
ErrorReader struct implements io.Reader interface. Its Read method returns zero and non-nil error on every call
type ErrorWriteCloser ¶ added in v0.2.10
type ErrorWriteCloser struct{}
func (ErrorWriteCloser) Close ¶ added in v0.2.10
func (ew ErrorWriteCloser) Close() error
type ErrorWriter ¶ added in v0.2.10
type ErrorWriter struct{}
ErrorWriter struct implements io.Writer interface. Its Write method returns zero and non-nil error on every call
type FileReaderMaker ¶
type FileReaderMaker struct {
Key string
}
FileReaderMaker decompresses lzop tarballs from the passed in file.
func (*FileReaderMaker) Path ¶
func (f *FileReaderMaker) Path() string
func (*FileReaderMaker) Reader ¶
func (f *FileReaderMaker) Reader() (io.ReadCloser, error)
Reader creates a new reader from the passed in file.
type FileTarBall ¶
type FileTarBall struct {
// contains filtered or unexported fields
}
FileTarBall represents a tarball that is written to disk.
func (*FileTarBall) AddSize ¶
func (tarBall *FileTarBall) AddSize(i int64)
func (*FileTarBall) AwaitUploads ¶
func (tarBall *FileTarBall) AwaitUploads()
func (*FileTarBall) CloseTar ¶
func (tarBall *FileTarBall) CloseTar() error
CloseTar closes the tar writer and file, flushing any unwritten data to the file before closing.
func (*FileTarBall) SetUp ¶
func (tarBall *FileTarBall) SetUp(crypter crypto.Crypter, names ...string)
SetUp creates a new LZ4 writer, tar writer and file for writing bundled compressed bytes to.
func (*FileTarBall) Size ¶
func (tarBall *FileTarBall) Size() int64
func (*FileTarBall) TarWriter ¶
func (tarBall *FileTarBall) TarWriter() *tar.Writer
type FileTarBallMaker ¶
type FileTarBallMaker struct { Out string // contains filtered or unexported fields }
FileTarBallMaker creates a new FileTarBall with the directory that files should be extracted to.
type MockCompressor ¶
type MockCompressor struct{}
func (*MockCompressor) FileExtension ¶
func (compressor *MockCompressor) FileExtension() string
func (*MockCompressor) NewWriter ¶
func (compressor *MockCompressor) NewWriter(writer io.Writer) io.WriteCloser
type MockDataFolder ¶
func NewMockDataFolder ¶
func NewMockDataFolder() *MockDataFolder
func (*MockDataFolder) CleanFolder ¶
func (folder *MockDataFolder) CleanFolder() error
func (*MockDataFolder) CreateFile ¶ added in v0.2.10
func (folder *MockDataFolder) CreateFile(filename string) error
func (*MockDataFolder) DeleteFile ¶ added in v0.2.10
func (folder *MockDataFolder) DeleteFile(filename string) error
func (*MockDataFolder) FileExists ¶ added in v0.2.10
func (folder *MockDataFolder) FileExists(filename string) bool
func (*MockDataFolder) IsEmpty ¶
func (folder *MockDataFolder) IsEmpty() bool
func (*MockDataFolder) OpenReadonlyFile ¶
func (folder *MockDataFolder) OpenReadonlyFile(filename string) (io.ReadCloser, error)
func (*MockDataFolder) OpenWriteOnlyFile ¶
func (folder *MockDataFolder) OpenWriteOnlyFile(filename string) (io.WriteCloser, error)
type MockReadWriteCloser ¶
type MockReadWriteCloser struct{}
func (*MockReadWriteCloser) Close ¶
func (readWriterCloser *MockReadWriteCloser) Close() error
type NopCloserWriter ¶ added in v0.2.10
func (NopCloserWriter) Close ¶ added in v0.2.10
func (NopCloserWriter) Close() error
type ReadWriteNopCloser ¶
type ReadWriteNopCloser struct {
io.ReadWriter
}
func (*ReadWriteNopCloser) Close ¶
func (readWriteNopCloser *ReadWriteNopCloser) Close() error
type StrideByteReader ¶
type StrideByteReader struct {
// contains filtered or unexported fields
}
StrideByteReader allows for customizable "strides" of random bytes. Creates an infinite stream.
func NewStrideByteReader ¶
func NewStrideByteReader(s int) *StrideByteReader
NewStrideByteReader creates a new random byte stride generator with a seed of 0.