digest

package
v0.0.0-...-390575e Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: GPL-3.0 Imports: 37 Imported by: 0

Documentation

Overview

Package digest provides api features.

Index

Constants

This section is empty.

Variables

View Source
var (
	HandlerPathTimeStampService = `/timestamp/{contract:.*}/service`
	HandlerPathTimeStampItem    = `/timestamp/{contract:.*}/project/{project:.+}/id/{tid:[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,
) error

func Timestamp

func Timestamp(st *currencydigest.Database, contract string) (types.Design, mitumbase.State, error)

func TimestampItem

func TimestampItem(st *currencydigest.Database, contract, project string, idx uint64) (types.TimeStampItem, mitumbase.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(ctx 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,
	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 TimeStampItemDoc

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

func NewTimeStampItemDoc

func NewTimeStampItemDoc(st base.State, enc encoder.Encoder) (TimeStampItemDoc, error)

func (TimeStampItemDoc) MarshalBSON

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

type TimeStampServiceDesignDoc

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

func NewTimeStampServiceDesignDoc

func NewTimeStampServiceDesignDoc(st base.State, enc encoder.Encoder) (TimeStampServiceDesignDoc, error)

NewTimeStampServiceDesignDoc gets the State of TimeStampServiceDesign

func (TimeStampServiceDesignDoc) MarshalBSON

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

Jump to

Keyboard shortcuts

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