ipld

package
v5.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: Apache-2.0, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalCBOR

func MarshalCBOR(o cbor.Marshaler) (cid.Cid, []byte, error)

Marshals an object to bytes for storing in state.

func NewADTStore

func NewADTStore(ctx context.Context) adt.Store

Creates a new, empty, unsynchronized IPLD store in memory. This store is appropriate for most kinds of testing.

Types

type BlockStoreInMemory

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

A basic in-memory block store.

func NewBlockStoreInMemory

func NewBlockStoreInMemory() *BlockStoreInMemory

func (*BlockStoreInMemory) Get

func (mb *BlockStoreInMemory) Get(c cid.Cid) (block.Block, error)

func (*BlockStoreInMemory) Put

func (mb *BlockStoreInMemory) Put(b block.Block) error

type MetricsBlockStore

type MetricsBlockStore struct {
	Writes     uint64
	WriteBytes uint64
	Reads      uint64
	ReadBytes  uint64
	// contains filtered or unexported fields
}

Metric-recording block store wrapper.

func NewMetricsBlockStore

func NewMetricsBlockStore(underlying ipldcbor.IpldBlockstore) *MetricsBlockStore

func (*MetricsBlockStore) Get

func (ms *MetricsBlockStore) Get(c cid.Cid) (block.Block, error)

func (*MetricsBlockStore) Put

func (ms *MetricsBlockStore) Put(b block.Block) error

func (*MetricsBlockStore) ReadCount

func (ms *MetricsBlockStore) ReadCount() uint64

func (*MetricsBlockStore) ReadSize

func (ms *MetricsBlockStore) ReadSize() uint64

func (*MetricsBlockStore) WriteCount

func (ms *MetricsBlockStore) WriteCount() uint64

func (*MetricsBlockStore) WriteSize

func (ms *MetricsBlockStore) WriteSize() uint64

type SyncBlockStore

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

Synchronized block store wrapper.

func NewSyncBlockStore

func NewSyncBlockStore(bs ipldcbor.IpldBlockstore) *SyncBlockStore

func (*SyncBlockStore) Get

func (ss *SyncBlockStore) Get(c cid.Cid) (block.Block, error)

func (*SyncBlockStore) Put

func (ss *SyncBlockStore) Put(b block.Block) error

Jump to

Keyboard shortcuts

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