pendingtx

package
v0.0.0-...-f498596 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KafkaClient

type KafkaClient struct {
	Topic string
	*kafka.Writer
}

func NewKafkaClient

func NewKafkaClient(addrs []string, topic string) *KafkaClient

func (*KafkaClient) SendPending

func (kc *KafkaClient) SendPending(hash []byte, tx *watcher.Transaction) error

func (*KafkaClient) SendRmPending

func (kc *KafkaClient) SendRmPending(hash []byte, tx *RmPendingTx) error

type PendingMsg

type PendingMsg struct {
	Topic  string      `json:"topic"`
	Source interface{} `json:"source"`
	// not use interface for fast json
	Data *watcher.Transaction `json:"data"`
}

func (*PendingMsg) MarshalJSON

func (j *PendingMsg) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*PendingMsg) MarshalJSONBuf

func (j *PendingMsg) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

func (*PendingMsg) UnmarshalJSON

func (j *PendingMsg) UnmarshalJSON(input []byte) error

UnmarshalJSON umarshall json - template of ffjson

func (*PendingMsg) UnmarshalJSONFFLexer

func (j *PendingMsg) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

UnmarshalJSONFFLexer fast json unmarshall - template ffjson

type RmPendingMsg

type RmPendingMsg struct {
	Topic  string      `json:"topic"`
	Source interface{} `json:"source"`
	// not use interface for fast json
	Data *RmPendingTx `json:"data"`
}

func (*RmPendingMsg) MarshalJSON

func (j *RmPendingMsg) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*RmPendingMsg) MarshalJSONBuf

func (j *RmPendingMsg) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

func (*RmPendingMsg) UnmarshalJSON

func (j *RmPendingMsg) UnmarshalJSON(input []byte) error

UnmarshalJSON umarshall json - template of ffjson

func (*RmPendingMsg) UnmarshalJSONFFLexer

func (j *RmPendingMsg) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

UnmarshalJSONFFLexer fast json unmarshall - template ffjson

type RmPendingTx

type RmPendingTx struct {
	From   string                  `json:"from"`
	Hash   string                  `json:"hash"`
	Nonce  string                  `json:"nonce"`
	Delete bool                    `json:"delete"`
	Reason types.RmPendingTxReason `json:"reason"`
}

func (*RmPendingTx) MarshalJSON

func (j *RmPendingTx) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*RmPendingTx) MarshalJSONBuf

func (j *RmPendingTx) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

func (*RmPendingTx) UnmarshalJSON

func (j *RmPendingTx) UnmarshalJSON(input []byte) error

UnmarshalJSON umarshall json - template of ffjson

func (*RmPendingTx) UnmarshalJSONFFLexer

func (j *RmPendingTx) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

UnmarshalJSONFFLexer fast json unmarshall - template ffjson

type Sender

type Sender interface {
	SendPending(hash []byte, tx *watcher.Transaction) error
	SendRmPending(hash []byte, tx *RmPendingTx) error
}

type Watcher

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

func NewWatcher

func NewWatcher(clientCtx context.CLIContext, log log.Logger, sender Sender) *Watcher

func (*Watcher) Start

func (w *Watcher) Start()

Jump to

Keyboard shortcuts

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