Documentation
¶
Index ¶
- Constants
- Variables
- func PunchHole(f *os.File, offset, size int64) error
- type BlockReader
- type BlockRsyncOptions
- type BlockrsyncClient
- type BlockrsyncServer
- type ConnectionProvider
- type FileHasher
- func (f *FileHasher) BlockSize() int64
- func (f *FileHasher) DeserializeHashes(r io.Reader) (int64, map[int64][]byte, error)
- func (f *FileHasher) DiffHashes(blockSize int64, cmpHash map[int64][]byte) ([]int64, error)
- func (f *FileHasher) GetHashes() map[int64][]byte
- func (f *FileHasher) HashFile(fileName string) (int64, error)
- func (f *FileHasher) SerializeHashes(w io.Writer) error
- type Hasher
- type NetworkConnectionProvider
- type OffsetHash
- type Progress
Constants ¶
View Source
const ( Hole byte = iota Block )
View Source
const ( FALLOC_FL_KEEP_SIZE = 0x01 /* default is extend size */ FALLOC_FL_PUNCH_HOLE = 0x02 /* de-allocates range */ )
View Source
const (
DefaultBlockSize = int64(64 * 1024)
)
Variables ¶
View Source
var (
ErrPunchHoleNotSupported = errors.New("this filesystem does not support punching holes. Use xfs, ext4, btrfs or such")
)
Functions ¶
Types ¶
type BlockReader ¶
type BlockReader struct {
// contains filtered or unexported fields
}
func NewBlockReader ¶
func (*BlockReader) Block ¶
func (b *BlockReader) Block() []byte
func (*BlockReader) IsHole ¶
func (b *BlockReader) IsHole() bool
func (*BlockReader) Next ¶
func (b *BlockReader) Next() (bool, error)
func (*BlockReader) Offset ¶
func (b *BlockReader) Offset() int64
type BlockRsyncOptions ¶
type BlockrsyncClient ¶
type BlockrsyncClient struct {
// contains filtered or unexported fields
}
func NewBlockrsyncClient ¶
func NewBlockrsyncClient(sourceFile, targetAddress string, port int, opts *BlockRsyncOptions, logger logr.Logger) *BlockrsyncClient
func (*BlockrsyncClient) ConnectToTarget ¶
func (b *BlockrsyncClient) ConnectToTarget() error
type BlockrsyncServer ¶
type BlockrsyncServer struct {
// contains filtered or unexported fields
}
func NewBlockrsyncServer ¶
func NewBlockrsyncServer(targetFile string, port int, opts *BlockRsyncOptions, logger logr.Logger) *BlockrsyncServer
func (*BlockrsyncServer) StartServer ¶
func (b *BlockrsyncServer) StartServer() error
type ConnectionProvider ¶
type ConnectionProvider interface {
Connect() (io.ReadWriteCloser, error)
}
type FileHasher ¶
type FileHasher struct {
// contains filtered or unexported fields
}
func (*FileHasher) BlockSize ¶
func (f *FileHasher) BlockSize() int64
func (*FileHasher) DeserializeHashes ¶
func (*FileHasher) DiffHashes ¶
func (*FileHasher) GetHashes ¶
func (f *FileHasher) GetHashes() map[int64][]byte
func (*FileHasher) SerializeHashes ¶
func (f *FileHasher) SerializeHashes(w io.Writer) error
type Hasher ¶
type NetworkConnectionProvider ¶
type NetworkConnectionProvider struct {
// contains filtered or unexported fields
}
func (*NetworkConnectionProvider) Connect ¶
func (n *NetworkConnectionProvider) Connect() (io.ReadWriteCloser, error)
type OffsetHash ¶
Click to show internal directories.
Click to hide internal directories.