digest

package
v0.0.0-...-b43498b Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: GPL-3.0 Imports: 35 Imported by: 0

Documentation

Overview

Package digest provides api features.

Index

Constants

This section is empty.

Variables

View Source
var (
	HandlerPathToken        = `/token/{contract:(?i)` + base.REStringAddressString + `}`
	HandlerPathTokenBalance = `/token/{contract:(?i)` + base.REStringAddressString + `}/account/{address:(?i)` + base.REStringAddressString + `}` // revive:disable-line:line-length-limit
)

Functions

func DigestBlock

func DigestBlock(
	ctx context.Context,
	st *currencydigest.Database,
	blk base.BlockMap,
	ops []base.Operation,
	opstree fixedtree.Tree,
	sts []base.State,
	proposal base.ProposalSignFact,
	vs string,
) error

func Token

func Token(st *currencydigest.Database, contract string) (*types.Design, error)

func TokenBalance

func TokenBalance(st *currencydigest.Database, contract, account string) (*common.Big, error)

Types

type BlockSession

type BlockSession struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*BlockSession) Close

func (bs *BlockSession) Close() error

func (*BlockSession) Commit

func (bs *BlockSession) Commit(_ context.Context) error

func (*BlockSession) Prepare

func (bs *BlockSession) Prepare() error

type Digester

type Digester struct {
	sync.RWMutex
	*util.ContextDaemon
	*logging.Logging
	// contains filtered or unexported fields
}

func NewDigester

func NewDigester(
	st *currencydigest.Database,
	root string,
	sourceReaders *isaac.BlockItemReaders,
	fromRemotes isaac.RemotesBlockItemReadFunc,
	networkID base.NetworkID,
	vs string,
	errChan chan error,
) *Digester

func (*Digester) Digest

func (di *Digester) Digest(blocks []base.BlockMap)

type Handlers

type Handlers struct {
	*zerolog.Logger
	// contains filtered or unexported fields
}

func NewHandlers

func NewHandlers(
	ctx context.Context,
	networkID base.NetworkID,
	encs *encoder.Encoders,
	enc encoder.Encoder,
	st *currencydigest.Database,
	cache currencydigest.Cache,
	router *mux.Router,
	routes map[string]*mux.Route,
) *Handlers

func (*Handlers) Cache

func (hd *Handlers) Cache() currencydigest.Cache

func (*Handlers) Handler

func (hd *Handlers) Handler() http.Handler

func (*Handlers) Initialize

func (hd *Handlers) Initialize() error

func (*Handlers) Router

func (hd *Handlers) Router() *mux.Router

func (*Handlers) SetLimiter

func (hd *Handlers) SetLimiter(f func(string) int64) *Handlers

type TokenBalanceDoc

type TokenBalanceDoc struct {
	mongodbstorage.BaseDoc
	// contains filtered or unexported fields
}

func NewTokenBalanceDoc

func NewTokenBalanceDoc(st base.State, enc encoder.Encoder) (*TokenBalanceDoc, error)

func (TokenBalanceDoc) MarshalBSON

func (doc TokenBalanceDoc) MarshalBSON() ([]byte, error)

type TokenDoc

type TokenDoc struct {
	mongodbstorage.BaseDoc
	// contains filtered or unexported fields
}

func NewTokenDoc

func NewTokenDoc(st base.State, enc encoder.Encoder) (TokenDoc, error)

func (TokenDoc) MarshalBSON

func (doc TokenDoc) MarshalBSON() ([]byte, error)

Jump to

Keyboard shortcuts

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