io

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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) Close

func (r *Reader) Close() error

func (*Reader) Cluster

func (r *Reader) Cluster() (io.Reader, error)

func (*Reader) CreateTarArchiveReader

func (r *Reader) CreateTarArchiveReader() (io.ReadCloser, error)

func (*Reader) ForEachFile

func (r *Reader) ForEachFile(visitor func(io.Reader, babuzapb.SnapshotFileDesc) error) error

func (*Reader) Metadata

func (r *Reader) Metadata() babuzapb.SnapshotMetadata

func (*Reader) Open

func (r *Reader) Open(fileTag string) (io.Reader, ibabuza.StateMachineFileDesc, error)

func (*Reader) Session

func (r *Reader) Session() (io.Reader, error)

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

func (*Receiver) Commit

func (r *Receiver) Commit(snapshotIndex uint64) error

func (*Receiver) DeleteDir

func (r *Receiver) DeleteDir() error

func (*Receiver) SaveChunk

func (r *Receiver) SaveChunk(snapshotIndex uint64, msg babuzapb.SnapshotChunkMessage) error

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 (w *Writer) AddStateMachineFileMetadata(fileTag string, metadata []byte) error

func (*Writer) Commit

func (w *Writer) Commit(snap raftpb.Snapshot) (babuzapb.SnapshotMetadata, error)

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)

func (*Writer) Dir

func (w *Writer) Dir() string

Jump to

Keyboard shortcuts

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