service

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: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCCESS = 0
	FAIL    = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpHandler

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

func NewHttpHandler

func NewHttpHandler(cfg *config.Config, log *xlog.XLog) *HttpHandler

func (*HttpHandler) AddSubFilter added in v0.5.1

func (s *HttpHandler) AddSubFilter(c *gin.Context)

func (*HttpHandler) DelMonitorAddress

func (s *HttpHandler) DelMonitorAddress(c *gin.Context)

func (*HttpHandler) DelSubFilter added in v0.5.1

func (s *HttpHandler) DelSubFilter(c *gin.Context)

func (*HttpHandler) Error

func (s *HttpHandler) Error(c *gin.Context, path string, err string)

func (*HttpHandler) GetMonitorAddress

func (s *HttpHandler) GetMonitorAddress(c *gin.Context)

func (*HttpHandler) MonitorAddress

func (s *HttpHandler) MonitorAddress(c *gin.Context)

func (*HttpHandler) NewToken

func (s *HttpHandler) NewToken(c *gin.Context)

func (*HttpHandler) QuerySubFilter added in v0.5.1

func (s *HttpHandler) QuerySubFilter(c *gin.Context)

func (*HttpHandler) Success

func (s *HttpHandler) Success(c *gin.Context, resp interface{}, path string)

type StoreHandler

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

func NewStoreHandler

func NewStoreHandler(config *config.Config, log *xlog.XLog) *StoreHandler

func (*StoreHandler) ReadBackupTxFromKafka added in v0.5.1

func (s *StoreHandler) ReadBackupTxFromKafka(blockChain int64, kafkaCfg map[string]*config.KafkaConfig, ctx context.Context)

func (*StoreHandler) ReadBlockFromKafka

func (s *StoreHandler) ReadBlockFromKafka(blockChain int64, kafkaCfg map[string]*config.KafkaConfig, ctx context.Context)

func (*StoreHandler) ReadReceiptFromKafka

func (s *StoreHandler) ReadReceiptFromKafka(blockChain int64, kafkaCfg map[string]*config.KafkaConfig, ctx context.Context)

func (*StoreHandler) ReadSubTxFromKafka

func (s *StoreHandler) ReadSubTxFromKafka(blockChain int64, kafkaCfg map[string]*config.KafkaConfig, ctx context.Context)

func (*StoreHandler) ReadTxFromKafka

func (s *StoreHandler) ReadTxFromKafka(blockChain int64, kafkaCfg map[string]*config.KafkaConfig, ctx context.Context)

func (*StoreHandler) Start

func (s *StoreHandler) Start(ctx context.Context)

type TokenAddress

type TokenAddress struct {
	Token string
	List  map[string]*store.MonitorAddress
}

type WsHandler

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

func NewWsHandler

func NewWsHandler(cfg *config.Config, log *xlog.XLog) *WsHandler

func (*WsHandler) Start

func (ws *WsHandler) Start(kafkaCtx context.Context)

func (*WsHandler) Sub

func (ws *WsHandler) Sub(w http.ResponseWriter, r *http.Request, token string)

func (*WsHandler) Sub2

func (ws *WsHandler) Sub2(ctx *gin.Context, w http.ResponseWriter, r *http.Request)

func (*WsHandler) TxEngine added in v0.5.1

func (ws *WsHandler) TxEngine(filters map[string][]*store.SubFilter, monitorAddress map[string]*TokenAddress, msg *kafka.Message, blockChain int64, txType uint64) map[string]int64

TxEngine the method to verify tx and return

Jump to

Keyboard shortcuts

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