block_header

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2019 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware added in v0.4.3

type Middleware func(Store) Store

type Option added in v0.4.3

type Option func(*Options)

func Cache added in v0.4.3

func Cache() Option

Cache caches key secret pairs

type Options added in v0.4.3

type Options struct {
	Middlewares []Middleware
}

type Store

type Store interface {
	InsertTd(ctx context.Context, data *model.TotalDifficulty) error
	Insert(ctx context.Context, data *model.Header) error
	Delete(ctx context.Context, from, to int64) (err error)
	FindTd(ctx context.Context, hash []byte) (result *model.TotalDifficulty, err error)
	FindBlockByNumber(ctx context.Context, blockNumber int64) (result *model.Header, err error)
	FindBlockByHash(ctx context.Context, hash []byte) (result *model.Header, err error)
	FindLatestBlock(ctx context.Context) (result *model.Header, err error)
	CountBlocks(ctx context.Context) (uint64, error)
}

func NewWithDB

func NewWithDB(db DbOrTx, opts ...Option) Store

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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