indexes

package
v0.0.0-...-168a7d3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const AIndexesKeyPathPrefix = "/aya/chain/indexes/"
View Source
const StaticSize = 74

Variables

View Source
var (
	ErrCreateFailed = errors.New("create index services failed")
	ErrSyncRollback = errors.New("sync to target cid has rollback")
)

Functions

func ForkMerge

func ForkMerge(ind *core.IpfsNode, chainId string, index *Index) (cid.Cid, error)

Types

type Index

type Index struct {
	BlockIndex uint64 `json:"Index"`

	Hash EComm.Hash `json:"Hash"`

	FullCID cid.Cid `json:"FullCID"`
}

func (*Index) Decode

func (i *Index) Decode(bs []byte) error

func (*Index) Encode

func (i *Index) Encode() []byte

type IndexesServices

type IndexesServices interface {
	GetLatest() (*Index, error)

	SyncToCID(fullCID cid.Cid) error

	PutIndex(index *Index) (cid.Cid, error)

	GetIndex(blockNumber uint64) (*Index, error)

	PutIndexBy(num uint64, bhash EComm.Hash, cid cid.Cid) (cid.Cid, error)

	Close() error
}

func CreateServices

func CreateServices(ind *core.IpfsNode, chainId string, rcp bool) IndexesServices

Jump to

Keyboard shortcuts

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