digest

package
v0.0.0-...-b5b3c4d Latest Latest
Warning

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

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

Documentation

Overview

Package digest provides api features.

Index

Constants

This section is empty.

Variables

View Source
var (
	HandlerPathPrescriptionDesign = `/prescription/{contract:(?i)` + types.REStringAddressString + `}`
	HandlerPathPrescriptionInfo   = `/prescription/{contract:(?i)` + types.REStringAddressString + `}/hash/{prescription_hash:` + types.ReSpecialCh + `}`
)

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 PrescriptionDesign

func PrescriptionDesign(st *cdigest.Database, contract string) (types.Design, base.State, error)

func PrescriptionInfo

func PrescriptionInfo(db *cdigest.Database, contract, hash string) (*types.PrescriptionInfo, 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) Routes

func (hd *Handlers) Routes() map[string]*mux.Route

func (*Handlers) SetLimiter

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

type PrescriptionDesignDoc

type PrescriptionDesignDoc struct {
	mongodb.BaseDoc
	// contains filtered or unexported fields
}

func NewPrescriptionDesignDoc

func NewPrescriptionDesignDoc(st base.State, enc encoder.Encoder) (PrescriptionDesignDoc, error)

NewPrescriptionDesignDoc get the state of prescription Design

func (PrescriptionDesignDoc) MarshalBSON

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

type PrescriptionInfoDoc

type PrescriptionInfoDoc struct {
	mongodb.BaseDoc
	// contains filtered or unexported fields
}

func NewPrescriptionInfoDoc

func NewPrescriptionInfoDoc(st base.State, enc encoder.Encoder) (PrescriptionInfoDoc, error)

func (PrescriptionInfoDoc) MarshalBSON

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

Jump to

Keyboard shortcuts

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