digest

package
v0.0.0-...-dbcf2a3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Overview

Package digest provides api features.

Index

Constants

This section is empty.

Variables

View Source
var (
	HandlerPathTimeStampDesign = `/timestamp/{contract:(?i)` + types.REStringAddressString + `}`
	HandlerPathTimeStampItem   = `/timestamp/{contract:(?i)` + types.REStringAddressString + `}/project/{project_id:` + types.ReSpecialCh + `}/idx/{timestamp_idx:[0-9]+}`
)

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 TimestampDesign

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

func TimestampItem

func TimestampItem(db *cdigest.Database, contract, project string, idx uint64) (types.Item, base.State, 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 DesignDoc

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

func NewDesignDoc

func NewDesignDoc(st base.State, enc encoder.Encoder) (DesignDoc, error)

NewDesignDoc get the State of TimeStamp Design

func (DesignDoc) MarshalBSON

func (doc DesignDoc) MarshalBSON() ([]byte, 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 ItemDoc

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

func NewItemDoc

func NewItemDoc(st base.State, enc encoder.Encoder) (ItemDoc, error)

func (ItemDoc) MarshalBSON

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

Jump to

Keyboard shortcuts

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