state

package
v0.4.22-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: ISC Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const VERSION = 100

Variables

This section is empty.

Functions

This section is empty.

Types

type Location

type Location struct {
	Packfile uint64
	Offset   uint32
	Length   uint32
}

type Metadata

type Metadata struct {
	Version      uint32
	CreationTime time.Time
	Aggregate    bool
	Extends      [][32]byte
}

type State

type State struct {
	IdToChecksum map[uint64][32]byte

	Chunks map[uint64]Location

	Objects map[uint64]Location

	Files map[uint64]Location

	Directories map[uint64]Location

	Datas map[uint64]Location

	Snapshots map[uint64]Location

	DeletedSnapshots map[uint64]time.Time

	Metadata Metadata
	// contains filtered or unexported fields
}

func New

func New() *State

func NewFromBytes

func NewFromBytes(serialized []byte) (*State, error)

func (*State) ChunkExists

func (st *State) ChunkExists(chunkChecksum [32]byte) bool

func (*State) DataExists

func (st *State) DataExists(checksum [32]byte) bool

func (*State) DeleteSnapshot

func (st *State) DeleteSnapshot(snapshotChecksum [32]byte) error

func (*State) Derive

func (st *State) Derive() *State

func (*State) DirectoryExists

func (st *State) DirectoryExists(checksum [32]byte) bool

func (*State) Dirty

func (st *State) Dirty() bool

func (*State) Extends

func (st *State) Extends(stateID [32]byte)

func (*State) FileExists

func (st *State) FileExists(checksum [32]byte) bool

func (*State) GetPackfileForChunk

func (st *State) GetPackfileForChunk(chunkChecksum [32]byte) ([32]byte, bool)

func (*State) GetPackfileForData

func (st *State) GetPackfileForData(blobChecksum [32]byte) ([32]byte, bool)

func (*State) GetPackfileForDirectory

func (st *State) GetPackfileForDirectory(directoryChecksum [32]byte) ([32]byte, bool)

func (*State) GetPackfileForFile

func (st *State) GetPackfileForFile(fileChecksum [32]byte) ([32]byte, bool)

func (*State) GetPackfileForObject

func (st *State) GetPackfileForObject(objectChecksum [32]byte) ([32]byte, bool)

func (*State) GetSubpartForChunk

func (st *State) GetSubpartForChunk(chunkChecksum [32]byte) ([32]byte, uint32, uint32, bool)

func (*State) GetSubpartForData

func (st *State) GetSubpartForData(checksum [32]byte) ([32]byte, uint32, uint32, bool)

func (*State) GetSubpartForDirectory

func (st *State) GetSubpartForDirectory(checksum [32]byte) ([32]byte, uint32, uint32, bool)

func (*State) GetSubpartForFile

func (st *State) GetSubpartForFile(checksum [32]byte) ([32]byte, uint32, uint32, bool)

func (*State) GetSubpartForObject

func (st *State) GetSubpartForObject(objectChecksum [32]byte) ([32]byte, uint32, uint32, bool)

func (*State) GetSubpartForSnapshot

func (st *State) GetSubpartForSnapshot(checksum [32]byte) ([32]byte, uint32, uint32, bool)

func (*State) ListChunks

func (st *State) ListChunks() <-chan [32]byte

func (*State) ListObjects

func (st *State) ListObjects() <-chan [32]byte

func (*State) ListSnapshots

func (st *State) ListSnapshots() <-chan [32]byte

func (*State) Merge

func (st *State) Merge(stateID [32]byte, deltaState *State)

func (*State) ObjectExists

func (st *State) ObjectExists(objectChecksum [32]byte) bool

func (*State) ResetDirty

func (st *State) ResetDirty()

func (*State) Serialize

func (st *State) Serialize() ([]byte, error)

func (*State) SetPackfileForChunk

func (st *State) SetPackfileForChunk(packfileChecksum [32]byte, chunkChecksum [32]byte, packfileOffset uint32, chunkLength uint32)

func (*State) SetPackfileForData

func (st *State) SetPackfileForData(packfileChecksum [32]byte, blobChecksum [32]byte, packfileOffset uint32, chunkLength uint32)

func (*State) SetPackfileForDirectory

func (st *State) SetPackfileForDirectory(packfileChecksum [32]byte, directoryChecksum [32]byte, packfileOffset uint32, chunkLength uint32)

func (*State) SetPackfileForFile

func (st *State) SetPackfileForFile(packfileChecksum [32]byte, fileChecksum [32]byte, packfileOffset uint32, chunkLength uint32)

func (*State) SetPackfileForObject

func (st *State) SetPackfileForObject(packfileChecksum [32]byte, objectChecksum [32]byte, packfileOffset uint32, chunkLength uint32)

func (*State) SetPackfileForSnapshot

func (st *State) SetPackfileForSnapshot(packfileChecksum [32]byte, blobChecksum [32]byte, packfileOffset uint32, chunkLength uint32)

Jump to

Keyboard shortcuts

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