Documentation ¶
Index ¶
- Constants
- Variables
- func AssertReaderIsEmpty(t *testing.T, reader io.Reader)
- func Cleanup(t *testing.T, dir string)
- func CreateMockStorageFolder() storage.Folder
- func CreateMockStorageFolderWithDeltaBackups(t *testing.T) storage.Folder
- func CreateMockStorageFolderWithPermanentBackups(t *testing.T) storage.Folder
- func CreateMockStorageWalUploader() internal.Uploader
- func CreateNamedTar(w io.Writer, r *io.LimitedReader, name string)
- func CreatePostgresMockStorageFolderWithTimeMetadata(t *testing.T, dataFilling DataFilling) 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 MockLoggers() (InfoLoggerMock, ErrorLoggerMock)
- func NewMockUploader(apiMultiErr, apiErr bool) internal.Uploader
- func NewMockWalDirUploader(apiMultiErr, apiErr bool) *postgres.WalUploader
- func NewMockWalUploader(apiMultiErr, apiErr bool) *postgres.WalUploader
- func NewStoringMockUploader(storage *memory.Storage) 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) Name() string
- 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 ConcurrentConcatBufferTarInterpreter
- type DataFilling
- type ErrorLoggerMock
- 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) Name() string
- func (tarBall *FileTarBall) SetUp(crypter crypto.Crypter, names ...string)
- func (tarBall *FileTarBall) Size() int64
- func (tarBall *FileTarBall) TarWriter() *tar.Writer
- type FileTarBallMaker
- type InfoLoggerMock
- 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)
- func (folder *MockDataFolder) RenameFile(oldFilename string, newFilename string) error
- type MockFlusher
- type MockFlusherMockRecorder
- type MockReadSeekCloser
- type MockReadSeekCloserMockRecorder
- type MockReadWriteCloser
- type MockS3Client
- type MockS3Uploader
- type NOPTarInterpreter
- type NopCloser
- type NopCloserWriter
- type NopSeeker
- type ReadWriteNopCloser
- type StrideByteReader
Constants ¶
const ( SimplePath = "/simple" SkippedPath = "/skipped" IncrementedPath = "/incremented" )
Variables ¶
var ErrorMockClose = errors.New("mock close: close error")
var ErrorMockRead = errors.New("mock reader: read error")
var ErrorMockWrite = errors.New("mock writer: write error")
var IncrementedDescription = *internal.NewBackupFileDescription(true, false, time.Time{})
var SimpleDescription = *internal.NewBackupFileDescription(false, false, time.Time{})
var SkippedDescription = *internal.NewBackupFileDescription(false, true, time.Time{})
Functions ¶
func CreateNamedTar ¶
func CreateNamedTar(w io.Writer, r *io.LimitedReader, name string)
func CreatePostgresMockStorageFolderWithTimeMetadata ¶
func CreatePostgresMockStorageFolderWithTimeMetadata(t *testing.T, dataFilling DataFilling) storage.Folder
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 ¶
func CreateWalPageWithContinuation() []byte
func GetXLogRecordData ¶
func GetXLogRecordData() (walparser.XLogRecord, []byte)
func MakeDefaultUploader ¶
func MakeDefaultUploader(uploaderAPI s3manageriface.UploaderAPI) *s3.Uploader
func MockLoggers ¶
func MockLoggers() (InfoLoggerMock, ErrorLoggerMock)
func NewMockUploader ¶
func NewMockWalDirUploader ¶
func NewMockWalDirUploader(apiMultiErr, apiErr bool) *postgres.WalUploader
func NewMockWalUploader ¶
func NewMockWalUploader(apiMultiErr, apiErr bool) *postgres.WalUploader
Types ¶
type BackupFileListBuilder ¶
type BackupFileListBuilder struct {
// contains filtered or unexported fields
}
func NewBackupFileListBuilder ¶
func NewBackupFileListBuilder() BackupFileListBuilder
func (BackupFileListBuilder) Build ¶
func (listBuilder BackupFileListBuilder) Build() internal.BackupFileList
func (BackupFileListBuilder) WithIncremented ¶
func (listBuilder BackupFileListBuilder) WithIncremented() BackupFileListBuilder
func (BackupFileListBuilder) WithSimple ¶
func (listBuilder BackupFileListBuilder) WithSimple() BackupFileListBuilder
func (BackupFileListBuilder) WithSkipped ¶
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) Name ¶
func (tarBall *BufferTarBall) Name() string
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 ConcurrentConcatBufferTarInterpreter ¶
type ConcurrentConcatBufferTarInterpreter struct { Out map[string][]byte // contains filtered or unexported fields }
Extracts data (possibly from multiple sources concurrently) and stores it in dictionary. Used for testing purposes only.
func NewConcurrentConcatBufferTarInterpreter ¶
func NewConcurrentConcatBufferTarInterpreter() *ConcurrentConcatBufferTarInterpreter
type DataFilling ¶
type DataFilling int
const ( CreationTimeGaps DataFilling = iota NoCreationTime ModificationTimeGaps NoModificationTime CreationAndModificationTimeGaps NoTimeGaps )
type ErrorLoggerMock ¶
type ErrorLoggerMock struct {
Stats *callingFatalOnErrorFuncStats
}
func (ErrorLoggerMock) FatalOnError ¶
func (loggerMock ErrorLoggerMock) FatalOnError(err error)
type ErrorReader ¶
type ErrorReader struct{}
ErrorReader struct implements io.Reader interface. Its Read method returns zero and non-nil error on every call
type ErrorWriteCloser ¶
type ErrorWriteCloser struct{}
func (ErrorWriteCloser) Close ¶
func (ew ErrorWriteCloser) Close() error
type ErrorWriter ¶
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) FileType ¶
func (f *FileReaderMaker) FileType() internal.FileType
func (*FileReaderMaker) LocalPath ¶
func (f *FileReaderMaker) LocalPath() string
func (*FileReaderMaker) Mode ¶
func (f *FileReaderMaker) Mode() int64
func (*FileReaderMaker) Reader ¶
func (f *FileReaderMaker) Reader() (io.ReadCloser, error)
Reader creates a new reader from the passed in file.
func (*FileReaderMaker) StoragePath ¶
func (f *FileReaderMaker) StoragePath() string
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) Name ¶
func (tarBall *FileTarBall) Name() string
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 ¶
FileTarBallMaker creates a new FileTarBall with the directory that files should be extracted to.
type InfoLoggerMock ¶
type InfoLoggerMock struct {
Stats *callingPrintFuncStats
}
func (InfoLoggerMock) Println ¶
func (loggerMock InfoLoggerMock) Println(v ...interface{})
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 ¶
func (folder *MockDataFolder) CreateFile(filename string) error
func (*MockDataFolder) DeleteFile ¶
func (folder *MockDataFolder) DeleteFile(filename string) error
func (*MockDataFolder) FileExists ¶
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)
func (*MockDataFolder) RenameFile ¶
func (folder *MockDataFolder) RenameFile(oldFilename string, newFilename string) error
type MockFlusher ¶
type MockFlusher struct {
// contains filtered or unexported fields
}
MockFlusher is a mock of Flusher interface
func NewMockFlusher ¶
func NewMockFlusher(ctrl *gomock.Controller) *MockFlusher
NewMockFlusher creates a new mock instance
func (*MockFlusher) EXPECT ¶
func (m *MockFlusher) EXPECT() *MockFlusherMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockFlusherMockRecorder ¶
type MockFlusherMockRecorder struct {
// contains filtered or unexported fields
}
MockFlusherMockRecorder is the mock recorder for MockFlusher
func (*MockFlusherMockRecorder) Flush ¶
func (mr *MockFlusherMockRecorder) Flush() *gomock.Call
Flush indicates an expected call of Flush
type MockReadSeekCloser ¶
type MockReadSeekCloser struct {
// contains filtered or unexported fields
}
MockReadSeekCloser is a mock of ReadSeekCloser interface
func NewMockReadSeekCloser ¶
func NewMockReadSeekCloser(ctrl *gomock.Controller) *MockReadSeekCloser
NewMockReadSeekCloser creates a new mock instance
func (*MockReadSeekCloser) Close ¶
func (m *MockReadSeekCloser) Close() error
Close mocks base method
func (*MockReadSeekCloser) EXPECT ¶
func (m *MockReadSeekCloser) EXPECT() *MockReadSeekCloserMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockReadSeekCloserMockRecorder ¶
type MockReadSeekCloserMockRecorder struct {
// contains filtered or unexported fields
}
MockReadSeekCloserMockRecorder is the mock recorder for MockReadSeekCloser
func (*MockReadSeekCloserMockRecorder) Close ¶
func (mr *MockReadSeekCloserMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockReadSeekCloserMockRecorder) Read ¶
func (mr *MockReadSeekCloserMockRecorder) Read(p interface{}) *gomock.Call
Read indicates an expected call of Read
func (*MockReadSeekCloserMockRecorder) Seek ¶
func (mr *MockReadSeekCloserMockRecorder) Seek(offset, whence interface{}) *gomock.Call
Seek indicates an expected call of Seek
type MockReadWriteCloser ¶
type MockReadWriteCloser struct{}
func (*MockReadWriteCloser) Close ¶
func (readWriterCloser *MockReadWriteCloser) Close() error
type MockS3Client ¶
Mock out S3 client. Includes these methods: ListObjects(*ListObjectsV2Input) GetObject(*GetObjectInput) HeadObject(*HeadObjectInput)
func NewMockS3Client ¶
func NewMockS3Client(err, notFound bool) *MockS3Client
func (*MockS3Client) GetObject ¶
func (client *MockS3Client) GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error)
func (*MockS3Client) HeadObject ¶
func (client *MockS3Client) HeadObject(input *s3.HeadObjectInput) (*s3.HeadObjectOutput, error)
func (*MockS3Client) ListObjectsV2Pages ¶
func (client *MockS3Client) ListObjectsV2Pages(input *s3.ListObjectsV2Input, callback func(*s3.ListObjectsV2Output, bool) bool) error
type MockS3Uploader ¶
type MockS3Uploader struct { s3manageriface.UploaderAPI // contains filtered or unexported fields }
Mock out uploader client for S3. Includes these methods: Upload(*UploadInput, ...func(*s3manager.Uploader))
func NewMockS3Uploader ¶
func NewMockS3Uploader(multiErr, err bool, storage *memory.Storage) *MockS3Uploader
func (*MockS3Uploader) Upload ¶
func (uploader *MockS3Uploader) Upload(input *s3manager.UploadInput, f ...func(*s3manager.Uploader)) (*s3manager.UploadOutput, error)
type NopCloserWriter ¶
func (NopCloserWriter) Close ¶
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.