chunkstore

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TypeError = fmt.Errorf("type error")

Functions

This section is empty.

Types

type BitVector

type BitVector struct {
	Len int
	B   []byte
}

type ChunkType

type ChunkType int
const (
	DISCOVER ChunkType = iota
	SERVICE
	SOURCE
)

type Consumer

type Consumer struct {
	Overlay boson.Address
	Len     int
	B       []byte
	Time    int64
}

type Interface

type Interface interface {
	Init() error
	Put(chunkType ChunkType, reference boson.Address, providers []Provider) error
	Get(chunkType ChunkType, reference boson.Address) ([]Consumer, error)
	GetByOverlay(chunkType ChunkType, reference, overlay boson.Address) (Consumer, error)
	GetAll(chunkType ChunkType) (map[string][]Consumer, error)
	Remove(chunkType ChunkType, reference, overlay boson.Address) error
	RemoveAll(chunkType ChunkType, reference boson.Address) error
	Has(chunkType ChunkType, reference, overlay boson.Address) (bool, error)
	HasChunk(chunkType ChunkType, reference boson.Address, bit int) (bool, error)
	StartFinder(rootCid boson.Address)
	CancelFinder(rootCid boson.Address)
	IsFinder(rootCid boson.Address) bool
}

func New

func New(stateStore storage.StateStorer) Interface

type Provider

type Provider struct {
	Overlay boson.Address
	Bit     int
	Len     int
	B       []byte
	Time    int64
}

Jump to

Keyboard shortcuts

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