Documentation
¶
Index ¶
- type ChunkValidator
- type FileValidator
- type Installer
- type MetadataDecoder
- type MetadataEncoder
- type Reader
- func (r *Reader) Close() error
- func (r *Reader) Cluster() (io.Reader, error)
- func (r *Reader) CreateTarArchiveReader() (io.ReadCloser, error)
- func (r *Reader) ForEachFile(visitor func(io.Reader, babuzapb.SnapshotFileDesc) error) error
- func (r *Reader) Metadata() babuzapb.SnapshotMetadata
- func (r *Reader) Open(fileTag string) (io.Reader, ibabuza.StateMachineFileDesc, error)
- func (r *Reader) Session() (io.Reader, error)
- type Receiver
- type ValidateFile
- type Writer
- func (w *Writer) AddStateMachineFileMetadata(fileTag string, metadata []byte) error
- func (w *Writer) Commit(snap raftpb.Snapshot) (babuzapb.SnapshotMetadata, error)
- func (w *Writer) CreateClusterFile(compression babuzapb.SnapshotFileCompressionType) (io.WriteCloser, error)
- func (w *Writer) CreateSessionFile(compression babuzapb.SnapshotFileCompressionType) (io.WriteCloser, error)
- func (w *Writer) CreateStateMachineFile(fileTag string, compression babuzapb.SnapshotFileCompressionType) (io.WriteCloser, error)
- func (w *Writer) Dir() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChunkValidator ¶
type ChunkValidator struct {
// contains filtered or unexported fields
}
func NewChunkValidator ¶
func NewChunkValidator(fs api.SnapshotFileSystem, path string) *ChunkValidator
func (*ChunkValidator) ValidateAndAppend ¶
func (v *ChunkValidator) ValidateAndAppend(msg babuzapb.SnapshotChunkMessage) error
type FileValidator ¶
type FileValidator struct {
// contains filtered or unexported fields
}
func NewFileValidator ¶
func NewFileValidator(fs api.SnapshotFileSystem, metadataDecode MetadataDecoder) *FileValidator
func (*FileValidator) GetMetadataFile ¶ added in v0.1.2
func (f *FileValidator) GetMetadataFile(dir string) (babuzapb.SnapshotMetadata, error)
func (*FileValidator) ValidateSnapshotFiles ¶
func (f *FileValidator) ValidateSnapshotFiles(dir string, m babuzapb.SnapshotMetadata) error
type Installer ¶
type Installer interface { CommitSnapshot(folderType babuzapb.SnapshotFolderType, snapshotIndex uint64) error SnapshotVersion() uint64 }
type MetadataDecoder ¶
type MetadataDecoder interface {
Decode(srcR io.Reader) (babuzapb.SnapshotMetadata, error)
}
type MetadataEncoder ¶
type MetadataEncoder interface {
Encode(destW io.Writer, m babuzapb.SnapshotMetadata) error
}
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func NewReader ¶
func NewReader(fs api.SnapshotFileSystem, dir string, metadata babuzapb.SnapshotMetadata, metadataEncoder MetadataEncoder) *Reader
func (*Reader) CreateTarArchiveReader ¶
func (r *Reader) CreateTarArchiveReader() (io.ReadCloser, error)
func (*Reader) ForEachFile ¶
func (*Reader) Metadata ¶
func (r *Reader) Metadata() babuzapb.SnapshotMetadata
type Receiver ¶
type Receiver struct {
// contains filtered or unexported fields
}
func NewReceiver ¶
func NewReceiver(fs api.SnapshotFileSystem, dir string, metadata babuzapb.SnapshotMetadata, metadataEn MetadataEncoder, installer Installer, fileValidator ValidateFile) *Receiver
type ValidateFile ¶
type ValidateFile interface { GetMetadataFile(dir string) (babuzapb.SnapshotMetadata, error) ValidateSnapshotFiles(dir string, m babuzapb.SnapshotMetadata) error }
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func NewWriter ¶
func NewWriter(fs api.SnapshotFileSystem, dir string, metadataEn MetadataEncoder, installer Installer, snapshotIndex uint64) *Writer
func (*Writer) AddStateMachineFileMetadata ¶
func (*Writer) CreateClusterFile ¶
func (w *Writer) CreateClusterFile(compression babuzapb.SnapshotFileCompressionType) (io.WriteCloser, error)
func (*Writer) CreateSessionFile ¶
func (w *Writer) CreateSessionFile(compression babuzapb.SnapshotFileCompressionType) (io.WriteCloser, error)
func (*Writer) CreateStateMachineFile ¶
func (w *Writer) CreateStateMachineFile(fileTag string, compression babuzapb.SnapshotFileCompressionType) (io.WriteCloser, error)
Click to show internal directories.
Click to hide internal directories.