Documentation
¶
Index ¶
- Constants
- Variables
- type Batch
- type Cache
- type CheckCache
- func (c *CheckCache) Close() error
- func (c *CheckCache) GetChunkStatus(mac objects.MAC) ([]byte, error)
- func (c *CheckCache) GetObjectStatus(mac objects.MAC) ([]byte, error)
- func (c *CheckCache) GetPackfileStatus(mac objects.MAC) ([]byte, error)
- func (c *CheckCache) GetVFSEntryStatus(mac objects.MAC) ([]byte, error)
- func (c *CheckCache) GetVFSStatus(mac objects.MAC) ([]byte, error)
- func (c *CheckCache) PutChunkStatus(mac objects.MAC, err []byte) error
- func (c *CheckCache) PutObjectStatus(mac objects.MAC, err []byte) error
- func (c *CheckCache) PutPackfileStatus(mac objects.MAC, err []byte) error
- func (c *CheckCache) PutVFSEntryStatus(mac objects.MAC, err []byte) error
- func (c *CheckCache) PutVFSStatus(mac objects.MAC, err []byte) error
- type Constructor
- type DBStore
- type MaintenanceCache
- func (c *MaintenanceCache) Close() error
- func (c *MaintenanceCache) DeleletePackfiles(snapshotID objects.MAC) error
- func (c *MaintenanceCache) DeleteSnapshot(snapshotID objects.MAC) error
- func (c *MaintenanceCache) GetPackfiles(snapshotID objects.MAC) iter.Seq[objects.MAC]
- func (c *MaintenanceCache) HasPackfile(packfileMAC objects.MAC) bool
- func (c *MaintenanceCache) HasSnapshot(snapshotID objects.MAC) (bool, error)
- func (c *MaintenanceCache) PutPackfile(snapshotID, packfileMAC objects.MAC) error
- func (c *MaintenanceCache) PutSnapshot(snapshotID objects.MAC, data []byte) error
- type Manager
- func (m *Manager) Check() (*CheckCache, error)
- func (m *Manager) Close() error
- func (m *Manager) Maintenance(repositoryID uuid.UUID) (*MaintenanceCache, error)
- func (m *Manager) Packing() (*PackingCache, error)
- func (m *Manager) Repository(repositoryID uuid.UUID) (*_RepositoryCache, error)
- func (m *Manager) Scan(snapshotID objects.MAC) (*ScanCache, error)
- type Option
- type PackingCache
- func (c *PackingCache) Close() error
- func (c *PackingCache) GetIndexesBlob() iter.Seq[[]byte]
- func (c *PackingCache) HasBlob(Type resources.Type, mac objects.MAC) (bool, error)
- func (c *PackingCache) PutBlob(Type resources.Type, mac objects.MAC) error
- func (c *PackingCache) PutIndexBlob(Type resources.Type, mac objects.MAC, data []byte) error
- type SQLState
- func (c *SQLState) DelColoured(blobType resources.Type, blobCsum objects.MAC) error
- func (c *SQLState) DelDelta(blobType resources.Type, blobCsum, packfileMAC objects.MAC) error
- func (c *SQLState) DelPackfile(packfile objects.MAC) error
- func (c *SQLState) DelState(stateID objects.MAC) error
- func (c *SQLState) GetColouredEntries() iter.Seq2[objects.MAC, []byte]
- func (c *SQLState) GetColouredEntriesByType(blobType resources.Type) iter.Seq2[objects.MAC, []byte]
- func (c *SQLState) GetConfiguration(key string) ([]byte, error)
- func (c *SQLState) GetConfigurations() iter.Seq[[]byte]
- func (c *SQLState) GetDeletedEntries() iter.Seq[[]byte]
- func (c *SQLState) GetDelta(blobType resources.Type, blobCsum objects.MAC) iter.Seq2[objects.MAC, []byte]
- func (c *SQLState) GetDeltas() iter.Seq2[objects.MAC, []byte]
- func (c *SQLState) GetDeltasByType(blobType resources.Type) iter.Seq2[objects.MAC, []byte]
- func (c *SQLState) GetLatestState() (objects.MAC, error)
- func (c *SQLState) GetPackfiles() iter.Seq2[objects.MAC, []byte]
- func (c *SQLState) GetState(stateID objects.MAC) ([]byte, error)
- func (c *SQLState) GetStates() (map[objects.MAC][]byte, error)
- func (c *SQLState) HasColoured(blobType resources.Type, blobCsum objects.MAC) (bool, error)
- func (c *SQLState) HasPackfile(packfile objects.MAC) (bool, error)
- func (c *SQLState) HasState(stateID objects.MAC) (bool, error)
- func (c *SQLState) NewBatch() StateBatch
- func (c *SQLState) PutColoured(blobType resources.Type, blobCsum objects.MAC, data []byte) error
- func (c *SQLState) PutConfiguration(key string, data []byte) error
- func (c *SQLState) PutDeleted(typ uint8, blobCsum objects.MAC, data []byte) error
- func (c *SQLState) PutDelta(blobType resources.Type, blobCsum, packfile objects.MAC, data []byte) error
- func (c *SQLState) PutPackfile(packfile objects.MAC, data []byte) error
- func (c *SQLState) PutState(stateID objects.MAC, data []byte) error
- type SQLiteDBStore
- type ScanBatch
- type ScanCache
- func (c *ScanCache) Close() error
- func (c *ScanCache) DelColoured(blobType resources.Type, blobCsum objects.MAC) error
- func (c *ScanCache) DelDelta(blobType resources.Type, blobCsum, packfileMAC objects.MAC) error
- func (c *ScanCache) DelPackfile(packfile objects.MAC) error
- func (c *ScanCache) DelState(stateID objects.MAC) error
- func (c *ScanCache) EnumerateKeysWithPrefix(prefix string, reverse bool) iter.Seq2[string, []byte]
- func (c *ScanCache) GetColouredEntries() iter.Seq2[objects.MAC, []byte]
- func (c *ScanCache) GetColouredEntriesByType(blobType resources.Type) iter.Seq2[objects.MAC, []byte]
- func (c *ScanCache) GetConfiguration(key string) ([]byte, error)
- func (c *ScanCache) GetConfigurations() iter.Seq[[]byte]
- func (c *ScanCache) GetDeletedEntries() iter.Seq[[]byte]
- func (c *ScanCache) GetDelta(blobType resources.Type, blobCsum objects.MAC) iter.Seq2[objects.MAC, []byte]
- func (c *ScanCache) GetDeltas() iter.Seq2[objects.MAC, []byte]
- func (c *ScanCache) GetDeltasByType(blobType resources.Type) iter.Seq2[objects.MAC, []byte]
- func (c *ScanCache) GetDirectory(source int, directory string) ([]byte, error)
- func (c *ScanCache) GetFile(source int, file string) ([]byte, error)
- func (c *ScanCache) GetLatestState() (objects.MAC, error)
- func (c *ScanCache) GetPackfiles() iter.Seq2[objects.MAC, []byte]
- func (c *ScanCache) GetState(stateID objects.MAC) ([]byte, error)
- func (c *ScanCache) GetStates() (map[objects.MAC][]byte, error)
- func (c *ScanCache) HasColoured(blobType resources.Type, blobCsum objects.MAC) (bool, error)
- func (c *ScanCache) HasPackfile(packfile objects.MAC) (bool, error)
- func (c *ScanCache) HasState(stateID objects.MAC) (bool, error)
- func (c *ScanCache) NewBatch() StateBatch
- func (c *ScanCache) NewScanBatch() *ScanBatch
- func (c *ScanCache) PutColoured(blobType resources.Type, blobCsum objects.MAC, data []byte) error
- func (c *ScanCache) PutConfiguration(key string, data []byte) error
- func (c *ScanCache) PutDeleted(typ uint8, blobCsum objects.MAC, data []byte) error
- func (c *ScanCache) PutDelta(blobType resources.Type, blobCsum, packfile objects.MAC, data []byte) error
- func (c *ScanCache) PutDirectory(source int, directory string, data []byte) error
- func (c *ScanCache) PutFile(source int, file string, data []byte) error
- func (c *ScanCache) PutPackfile(packfile objects.MAC, data []byte) error
- func (c *ScanCache) PutState(stateID objects.MAC, data []byte) error
- type StateBatch
- type StateCache
Constants ¶
View Source
const CACHE_VERSION = "2.0.0"
Variables ¶
View Source
var (
ErrClosed = fmt.Errorf("cache closed")
)
Functions ¶
This section is empty.
Types ¶
type Batch ¶ added in v1.0.10
This is not goroutine safe, external synchronization must be provided.
type Cache ¶ added in v1.0.10
type Cache interface {
Put([]byte, []byte) error
Has([]byte) (bool, error)
Get([]byte) ([]byte, error)
// Must support Delete during Scan
Delete([]byte) error
// reverse is only to accomodate EnumerateKeysWithPrefix, once
// that doesn't need it anymore this can become simpler again.
// key returned by an iteration might get invalidated on
// subsequent iterations.
Scan([]byte, bool) iter.Seq2[[]byte, []byte]
NewBatch() Batch
Close() error
}
type CheckCache ¶
type CheckCache struct {
// contains filtered or unexported fields
}
func (*CheckCache) GetChunkStatus ¶
func (c *CheckCache) GetChunkStatus(mac objects.MAC) ([]byte, error)
func (*CheckCache) GetObjectStatus ¶
func (c *CheckCache) GetObjectStatus(mac objects.MAC) ([]byte, error)
func (*CheckCache) GetPackfileStatus ¶
func (c *CheckCache) GetPackfileStatus(mac objects.MAC) ([]byte, error)
func (*CheckCache) GetVFSEntryStatus ¶
func (c *CheckCache) GetVFSEntryStatus(mac objects.MAC) ([]byte, error)
func (*CheckCache) GetVFSStatus ¶
func (c *CheckCache) GetVFSStatus(mac objects.MAC) ([]byte, error)
func (*CheckCache) PutChunkStatus ¶
func (c *CheckCache) PutChunkStatus(mac objects.MAC, err []byte) error
func (*CheckCache) PutObjectStatus ¶
func (c *CheckCache) PutObjectStatus(mac objects.MAC, err []byte) error
func (*CheckCache) PutPackfileStatus ¶
func (c *CheckCache) PutPackfileStatus(mac objects.MAC, err []byte) error
func (*CheckCache) PutVFSEntryStatus ¶
func (c *CheckCache) PutVFSEntryStatus(mac objects.MAC, err []byte) error
func (*CheckCache) PutVFSStatus ¶
func (c *CheckCache) PutVFSStatus(mac objects.MAC, err []byte) error
type Constructor ¶ added in v1.0.10
type DBStore ¶
type DBStore[K any, V any] struct { Prefix string Cache *ScanCache // contains filtered or unexported fields }
DBStore implements btree.Storer
type MaintenanceCache ¶
type MaintenanceCache struct {
// contains filtered or unexported fields
}
func (*MaintenanceCache) DeleletePackfiles ¶
func (c *MaintenanceCache) DeleletePackfiles(snapshotID objects.MAC) error
func (*MaintenanceCache) DeleteSnapshot ¶
func (c *MaintenanceCache) DeleteSnapshot(snapshotID objects.MAC) error
func (*MaintenanceCache) GetPackfiles ¶
func (*MaintenanceCache) HasPackfile ¶
func (c *MaintenanceCache) HasPackfile(packfileMAC objects.MAC) bool
func (*MaintenanceCache) HasSnapshot ¶
func (c *MaintenanceCache) HasSnapshot(snapshotID objects.MAC) (bool, error)
func (*MaintenanceCache) PutPackfile ¶
func (c *MaintenanceCache) PutPackfile(snapshotID, packfileMAC objects.MAC) error
func (*MaintenanceCache) PutSnapshot ¶
func (c *MaintenanceCache) PutSnapshot(snapshotID objects.MAC, data []byte) error
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(cons Constructor) *Manager
func (*Manager) Check ¶
func (m *Manager) Check() (*CheckCache, error)
XXX - beware that caller has responsibility to call Close() on the returned cache
func (*Manager) Maintenance ¶
func (m *Manager) Maintenance(repositoryID uuid.UUID) (*MaintenanceCache, error)
func (*Manager) Packing ¶
func (m *Manager) Packing() (*PackingCache, error)
XXX - beware that caller has responsibility to call Close() on the returned cache
func (*Manager) Repository ¶
type PackingCache ¶
type PackingCache struct {
// contains filtered or unexported fields
}
func (*PackingCache) GetIndexesBlob ¶
func (c *PackingCache) GetIndexesBlob() iter.Seq[[]byte]
func (*PackingCache) PutIndexBlob ¶
type SQLState ¶ added in v1.1.0
type SQLState struct {
// contains filtered or unexported fields
}
func (*SQLState) DelColoured ¶ added in v1.1.0
func (*SQLState) DelPackfile ¶ added in v1.1.0
func (*SQLState) GetColouredEntries ¶ added in v1.1.0
func (*SQLState) GetColouredEntriesByType ¶ added in v1.1.0
func (*SQLState) GetConfiguration ¶ added in v1.1.0
func (*SQLState) GetConfigurations ¶ added in v1.1.0
func (*SQLState) GetDeletedEntries ¶ added in v1.1.0
func (*SQLState) GetDeltasByType ¶ added in v1.1.0
func (*SQLState) GetLatestState ¶ added in v1.1.0
func (*SQLState) GetPackfiles ¶ added in v1.1.0
func (*SQLState) HasColoured ¶ added in v1.1.0
func (*SQLState) HasPackfile ¶ added in v1.1.0
func (*SQLState) NewBatch ¶ added in v1.1.0
func (c *SQLState) NewBatch() StateBatch
func (*SQLState) PutColoured ¶ added in v1.1.0
func (*SQLState) PutConfiguration ¶ added in v1.1.0
Configuration handling
func (*SQLState) PutDeleted ¶ added in v1.1.0
Those two are only to construct deltas, when working with the local state we do the actual deletion.
func (*SQLState) PutPackfile ¶ added in v1.1.0
Packfile handling
type SQLiteDBStore ¶ added in v1.0.13
SQLiteDBStore implements btree.Storer
func NewSQLiteDBStore ¶ added in v1.0.13
func NewSQLiteDBStore[K, V any](storePath, storeName string) (*SQLiteDBStore[K, V], error)
func (*SQLiteDBStore[K, V]) Close ¶ added in v1.0.13
func (ds *SQLiteDBStore[K, V]) Close() error
type ScanBatch ¶ added in v1.0.10
type ScanBatch struct {
Batch
}
func (*ScanBatch) PutDirectory ¶ added in v1.0.10
type ScanCache ¶
type ScanCache struct {
// contains filtered or unexported fields
}
func (*ScanCache) DelColoured ¶ added in v1.1.0
func (*ScanCache) EnumerateKeysWithPrefix ¶
func (*ScanCache) GetColouredEntries ¶ added in v1.1.0
func (*ScanCache) GetColouredEntriesByType ¶ added in v1.1.0
func (*ScanCache) GetConfiguration ¶
func (*ScanCache) GetDeletedEntries ¶ added in v1.1.0
func (*ScanCache) GetDeltasByType ¶
func (*ScanCache) GetDirectory ¶
func (*ScanCache) GetLatestState ¶ added in v1.1.0
func (*ScanCache) HasColoured ¶ added in v1.1.0
func (*ScanCache) NewBatch ¶ added in v1.0.10
func (c *ScanCache) NewBatch() StateBatch
func (*ScanCache) NewScanBatch ¶ added in v1.0.10
func (*ScanCache) PutColoured ¶ added in v1.1.0
func (*ScanCache) PutConfiguration ¶
func (*ScanCache) PutDeleted ¶
Those two are only to construct deltas, when working with the local state we do the actual deletion.
func (*ScanCache) PutDirectory ¶
func (*ScanCache) PutPackfile ¶
type StateBatch ¶ added in v1.0.10
type StateCache ¶
type StateCache interface {
PutState(stateID objects.MAC, data []byte) error
HasState(stateID objects.MAC) (bool, error)
GetState(stateID objects.MAC) ([]byte, error)
GetLatestState() (objects.MAC, error)
DelState(stateID objects.MAC) error
GetStates() (map[objects.MAC][]byte, error)
PutDelta(blobType resources.Type, blobCsum, packfile objects.MAC, data []byte) error
GetDelta(blobType resources.Type, blobCsum objects.MAC) iter.Seq2[objects.MAC, []byte]
GetDeltasByType(blobType resources.Type) iter.Seq2[objects.MAC, []byte]
GetDeltas() iter.Seq2[objects.MAC, []byte]
DelDelta(blobType resources.Type, blobCsum objects.MAC, packfileMAC objects.MAC) error
// Solely for delta state construction.
PutDeleted(typ uint8, blobCsum objects.MAC, data []byte) error
GetDeletedEntries() iter.Seq[[]byte]
PutColoured(blobType resources.Type, blobCsum objects.MAC, data []byte) error
HasColoured(blobType resources.Type, blobCsum objects.MAC) (bool, error)
DelColoured(blobType resources.Type, blobCsum objects.MAC) error
GetColouredEntriesByType(blobType resources.Type) iter.Seq2[objects.MAC, []byte]
GetColouredEntries() iter.Seq2[objects.MAC, []byte]
PutPackfile(packfile objects.MAC, data []byte) error
DelPackfile(packfile objects.MAC) error
HasPackfile(packfile objects.MAC) (bool, error)
GetPackfiles() iter.Seq2[objects.MAC, []byte]
PutConfiguration(key string, data []byte) error
GetConfiguration(key string) ([]byte, error)
GetConfigurations() iter.Seq[[]byte]
NewBatch() StateBatch
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.