fsync

package
v1.0.0-rc6 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateMAC

func GenerateMAC(chainMac []byte, filename string) []byte

GenerateMAC returns a byte slice that is derived from the channel's mac and a file name

Types

type Adapter

type Adapter interface {
	GetFileSystem() config.FileSystem
	SendToPeer(*protos.SignedRKSyncMessage, *common.NetworkMember)
	Lookup(common.PKIidType) *common.NetworkMember
	Sign(*protos.RKSyncMessage) (*protos.SignedRKSyncMessage, error)
	GetMembership() []common.NetworkMember
	IsMemberInChan(common.NetworkMember) bool
	Accept(acceptor common.MessageAcceptor, mac []byte, passThrough bool) (<-chan *protos.RKSyncMessage, <-chan protos.ReceivedMessage)
}

Adapter enables the fsync to communicate with rksync channel

type FileSyncProvier

type FileSyncProvier struct {
	Adapter
	// contains filtered or unexported fields
}

FileSyncProvier is the file synchronization handler

func NewFileSyncProvider

func NewFileSyncProvider(chainMac common.ChainMac, chainID string, filename string, metadata []byte, mode protos.File_Mode, leader bool,
	pkiID common.PKIidType, adapter Adapter) (*FileSyncProvier, error)

NewFileSyncProvider creates FileSyncProvier instance

func (*FileSyncProvier) Stop

func (p *FileSyncProvier) Stop()

Stop stops the FileSyncProvider

type PayloadBuffer

type PayloadBuffer interface {
	Push(payload *protos.Payload)
	Next() int64
	Expire(delta int64)
	Peek() *protos.Payload
	Reset(delta int64)
	Size() int
	Ready() chan struct{}
	Close()
}

PayloadBuffer is used to store payloads into which used to support payloads with file blocks reordering according to the sequence number.

func NewPayloadBuffer

func NewPayloadBuffer(next int64) PayloadBuffer

NewPayloadBuffer is factory function to create new payloads buffer

Jump to

Keyboard shortcuts

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