ipld

package
v2.3.12 Latest Latest
Warning

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

Go to latest
Published: Apr 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 IPLD store in memory.

func NewSyncADTStore

func NewSyncADTStore(ctx context.Context) adt.Store

Creates a new, threadsafe, empty IPLD store in memory

Types

type BlockStoreInMemory

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

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 MetricsStore

type MetricsStore struct {
	Writes uint64
	Reads  uint64
	// contains filtered or unexported fields
}

func NewMetricsStore

func NewMetricsStore(underlying cbor.IpldBlockstore) *MetricsStore

func (*MetricsStore) Get

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

func (*MetricsStore) Put

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

func (*MetricsStore) ReadCount

func (ms *MetricsStore) ReadCount() uint64

func (*MetricsStore) WriteCount

func (ms *MetricsStore) WriteCount() uint64

type SyncBlockStoreInMemory

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

func NewSyncBlockStoreInMemory

func NewSyncBlockStoreInMemory() *SyncBlockStoreInMemory

func (*SyncBlockStoreInMemory) Get

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

func (*SyncBlockStoreInMemory) Put

Jump to

Keyboard shortcuts

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