storage

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: AGPL-3.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BlockInfoFinish = &BlockInfo{Block: -1}
View Source
var BlockTypeAny = -1
View Source
var BlockTypeDirty = 1
View Source
var BlockTypePriority = 2
View Source
var BlockTypeStandard = 0

Functions

func AddSiloEventNotification added in v0.0.10

func AddSiloEventNotification(s Provider, state EventType, callback EventCallback) bool

Try to add an event notification on a StorageProvider

func Equals

func Equals(sp1 Provider, sp2 Provider, blockSize int) (bool, error)

*

  • Check if two storageProviders hold the same data. *

func MapOverBlocks

func MapOverBlocks(offset int64, length int32, blockSize int, f func(b int, complete bool))

*

  • Map a function over blocks within the range. *

Types

type BlockInfo

type BlockInfo struct {
	Block int
	Type  int
}

type BlockOrder

type BlockOrder interface {
	AddAll()
	Add(block int)
	Remove(block int)
	GetNext() *BlockInfo
}

type EventCallback added in v0.0.10

type EventCallback func(event EventType, data EventData) EventReturnData

type EventData added in v0.0.10

type EventData interface{}

type EventReturnData added in v0.0.10

type EventReturnData interface{}

func SendSiloEvent added in v0.0.10

func SendSiloEvent(s Provider, eventType EventType, eventData EventData) []EventReturnData

Try to send an event for a given StorageProvider

type EventType added in v0.0.10

type EventType string

*

  • A StorageProvider can simply embed StorageProviderWithEvents to support events *

type ExposedStorage

type ExposedStorage interface {
	Init() error
	Shutdown() error
	Device() string
	SetProvider(prov Provider)
}

type LockableProvider added in v0.1.0

type LockableProvider interface {
	Provider
	Lock()
	Unlock()
}

type Provider added in v0.1.0

type Provider interface {
	io.ReaderAt
	io.WriterAt
	Size() uint64
	Flush() error
	Close() error
	CancelWrites(offset int64, length int64)
}

type ProviderWithEvents added in v0.1.0

type ProviderWithEvents struct {
	// contains filtered or unexported fields
}

func (*ProviderWithEvents) AddSiloEventNotification added in v0.1.0

func (spl *ProviderWithEvents) AddSiloEventNotification(eventType EventType, callback EventCallback)

Add a new callback for the given state.

func (*ProviderWithEvents) SendSiloEvent added in v0.1.0

func (spl *ProviderWithEvents) SendSiloEvent(eventType EventType, eventData EventData) []EventReturnData

Send an event, and notify any callbacks

type ProviderWithEventsIfc added in v0.1.0

type ProviderWithEventsIfc interface {
	Provider
	SendSiloEvent(EventType, EventData) []EventReturnData
	AddSiloEventNotification(EventType, EventCallback)
}

type SyncStartConfig added in v0.1.2

type SyncStartConfig struct {
	AlternateSources []packets.AlternateSource
	Destination      Provider
}

type TrackingProvider added in v0.1.0

type TrackingProvider interface {
	Provider
	Sync() *util.Bitfield
}

Jump to

Keyboard shortcuts

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