digest

package
v0.0.0-...-a82b3ad Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: GPL-3.0 Imports: 40 Imported by: 0

Documentation

Overview

Package digest provides api features.

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultColNamePayment        = "digest_pmt"
	DefaultColNamePaymentAccount = "digest_pmt_ac"
)
View Source
var (
	HandlerPathPaymentDesign      = `/payment/{contract:(?i)` + types.REStringAddressString + `}`
	HandlerPathPaymentAccountInfo = `/payment/{contract:(?i)` + types.REStringAddressString + `}/account/{address:(?i)` + types.REStringAddressString + `}`
)
View Source
var (
	AccountInfoValueHint = hint.MustNewHint("mitum-payment-account-info-value-v0.0.1")
)
View Source
var DefaultIndexes = cdigest.DefaultIndexes
View Source
var PaymentAccountRecordIndexModels = []mongo.IndexModel{
	{
		Keys: bson.D{
			bson.E{Key: "contract", Value: 1},
			bson.E{Key: "address", Value: 1},
			bson.E{Key: "height", Value: -1}},
		Options: options.Index().
			SetName(cdigest.IndexPrefix + "payment_contract_address_height"),
	},
}
View Source
var PaymentIndexModels = []mongo.IndexModel{
	{
		Keys: bson.D{
			bson.E{Key: "contract", Value: 1},
			bson.E{Key: "height", Value: -1}},
		Options: options.Index().
			SetName(cdigest.IndexPrefix + "payment_contract_height"),
	},
}

Functions

func DigestBlock

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

func PaymentDesign

func PaymentDesign(db *cdigest.Database, contract string) (*types.Design, base.State, error)

Types

type AccountInfoValue

type AccountInfoValue struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func AccountInfo

func AccountInfo(db *cdigest.Database, contract, account string) (*AccountInfoValue, error)

func NewAccountInfoValue

func NewAccountInfoValue(
	setting types.Setting,
	record types.DepositRecord,
) AccountInfoValue

func (AccountInfoValue) AccountInfo

func (ai AccountInfoValue) AccountInfo() types.Setting

func (AccountInfoValue) AccountRecord

func (ai AccountInfoValue) AccountRecord() types.DepositRecord

func (AccountInfoValue) Hint

func (ai AccountInfoValue) Hint() hint.Hint

func (AccountInfoValue) MarshalJSON

func (ai AccountInfoValue) MarshalJSON() ([]byte, error)

type AccountInfoValueJSONMarshaler

type AccountInfoValueJSONMarshaler struct {
	hint.BaseHinter
	Setting types.Setting       `json:"transfer_setting"`
	Record  types.DepositRecord `json:"deposit_record"`
}

type BlockSession

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

func NewBlockSession

func NewBlockSession(
	st *cdigest.Database,
	blk base.BlockMap,
	ops []base.Operation,
	opstree fixedtree.Tree,
	sts []base.State,
	proposal base.ProposalSignFact,
	vs string,
) (*BlockSession, error)

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 DepositRecordDoc

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

func NewDepositRecordDoc

func NewDepositRecordDoc(st base.State, enc encoder.Encoder) (*DepositRecordDoc, error)

func (DepositRecordDoc) MarshalBSON

func (doc DepositRecordDoc) MarshalBSON() ([]byte, 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 *cdigest.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 *cdigest.Database,
	cache cdigest.Cache,
	router *mux.Router,
	routes map[string]*mux.Route,
) *Handlers

func (*Handlers) Cache

func (hd *Handlers) Cache() cdigest.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

Jump to

Keyboard shortcuts

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