db

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ContractKey      = "contract_%v"
	ErrTxKey         = "errTx_%v"
	NodeTaskKey      = "nodeTask_%v"
	MonitorKey       = "monitorAddress_%v"
	LatestBlockKey   = "latestBlock"
	NodeKey          = "nodeKey_%v"
	ClusterKey       = "cluster_%v_%v"
	ClusterHealthKey = "clusterHealth_%v"
)

Functions

func NewTaskCacheService

func NewTaskCacheService(cfg *config.Chain, x *xlog.XLog) collect.StoreTaskInterface

func NewTaskCacheService2 added in v0.5.1

func NewTaskCacheService2(cfg *config.Chain, x *logrus.Entry) collect.StoreTaskInterface

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func (*Service) DelErrTxNodeTask

func (s *Service) DelErrTxNodeTask(blockchain int64, key string) (*collect.NodeTask, error)

func (*Service) DelNodeTask

func (s *Service) DelNodeTask(blockchain int64, key string) (int64, *collect.NodeTask, error)

func (*Service) GetAllKeyForContract

func (s *Service) GetAllKeyForContract(blockchain int64) ([]string, error)

func (*Service) GetAllKeyForErrTx

func (s *Service) GetAllKeyForErrTx(blockchain int64) ([]string, error)

func (*Service) GetAllKeyForNodeTask

func (s *Service) GetAllKeyForNodeTask(blockchain int64) ([]string, error)

func (*Service) GetAllNodeId

func (s *Service) GetAllNodeId(blockchain int64) ([]string, error)

func (*Service) GetClusterNode

func (s *Service) GetClusterNode(blockChain int64, prefix string) (map[string]int64, error)

func (*Service) GetContract

func (s *Service) GetContract(blockchain int64, contract string) (string, error)

func (*Service) GetErrTxNodeTask

func (s *Service) GetErrTxNodeTask(blockchain int64, key string) (int64, *collect.NodeTask, error)

func (*Service) GetMonitorAddress

func (s *Service) GetMonitorAddress(blockChain int64) ([]string, error)

func (*Service) GetNodeTask

func (s *Service) GetNodeTask(blockchain int64, key string) (int64, *collect.NodeTask, error)

func (*Service) ResetNodeTask

func (s *Service) ResetNodeTask(blockchain int64, oldKey, key string) error

func (*Service) SendNodeTask

func (s *Service) SendNodeTask(list []*collect.NodeTask, partitions []int64) []*kafka.Message

func (*Service) StoreClusterHealthStatus

func (s *Service) StoreClusterHealthStatus(blockChain int64, data map[string]int64) error

func (*Service) StoreClusterNode

func (s *Service) StoreClusterNode(blockChain int64, prefix string, data any) error

func (*Service) StoreContract

func (s *Service) StoreContract(blockchain int64, contract string, data string) error

func (*Service) StoreErrTxNodeTask

func (s *Service) StoreErrTxNodeTask(blockchain int64, key string, data any) error

func (*Service) StoreLatestBlock

func (s *Service) StoreLatestBlock(blockchain int64, key string, data any, number string) error

func (*Service) StoreNodeId

func (s *Service) StoreNodeId(blockchain int64, key string, data any) error

func (*Service) StoreNodeTask

func (s *Service) StoreNodeTask(key string, task *collect.NodeTask, append bool)

StoreNodeTask StoreExecTask key which tx:tx_txHash,receipt:receipt_txHash, block: block_number_blockHash

func (*Service) UpdateNodeTaskStatus

func (s *Service) UpdateNodeTaskStatus(key string, status int) error

func (*Service) UpdateNodeTaskStatusWithBatch

func (s *Service) UpdateNodeTaskStatusWithBatch(keys []string, status int) error

Jump to

Keyboard shortcuts

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