sender

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2019 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBKP_PRODUCER          = byte(1)
	DBKP_PRODUCER_HAS_SEND = byte(2)
)
View Source
const (
	STOPPED = iota
	RUNNING
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain interface {
	GetLatestBlockEventId() (uint64, error)
	GetEvent(eventId uint64) (byte, []types.Hash, error)
	GetConfirmSubLedgerBySnapshotBlocks(snapshotBlocks []*ledger.SnapshotBlock) (map[types.Address][]*ledger.AccountBlock, error)
	vm_context.Chain
}

type KafkaSender

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

func NewKafkaSender

func NewKafkaSender(chain Chain, dirName string) (*KafkaSender, error)

func (*KafkaSender) Producers

func (sender *KafkaSender) Producers() []*Producer

func (*KafkaSender) RunProducers

func (sender *KafkaSender) RunProducers() []*Producer

func (*KafkaSender) SetHasSend

func (sender *KafkaSender) SetHasSend(producerId uint8, hasSend uint64)

func (*KafkaSender) Start

func (sender *KafkaSender) Start(brokerList []string, topic string) error

func (*KafkaSender) Stop

func (sender *KafkaSender) Stop(brokerList []string, topic string)

func (*KafkaSender) StopAll

func (sender *KafkaSender) StopAll()

func (*KafkaSender) StopById

func (sender *KafkaSender) StopById(producerId uint8)

type MqAccountBlock

type MqAccountBlock struct {
	ledger.AccountBlock

	Balance     *big.Int      `json:"balance"`
	FromAddress types.Address `json:"fromAddress"`
	Timestamp   int64         `json:"timestamp"`

	ParsedData string `json:"parsedData"`
	SendData   []byte `json:"sendData"`
}

type MqSnapshotBlock

type MqSnapshotBlock struct {
	*ledger.SnapshotBlock
	MqSnapshotContent MqSnapshotContent `json:"snapshotContent"`
	Producer          types.Address     `json:"producer"`
	Timestamp         int64             `json:"timestamp"`
}

type MqSnapshotContent

type MqSnapshotContent map[types.Address]*MqSnapshotContentItem

type MqSnapshotContentItem

type MqSnapshotContentItem struct {
	Start *ledger.HashHeight `json:"start"`
	End   *ledger.HashHeight `json:"end"`
}

type Producer

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

func NewProducer

func NewProducer(producerId uint8, brokerList []string, topic string, chain Chain, db *leveldb.DB) (*Producer, error)

func NewProducerFromDb

func NewProducerFromDb(producerId uint8, buf []byte, chain Chain, db *leveldb.DB) (*Producer, error)

func (*Producer) BrokerList

func (producer *Producer) BrokerList() []string

func (*Producer) Deserialize

func (producer *Producer) Deserialize(buffer []byte) error

func (*Producer) HasSend

func (producer *Producer) HasSend() uint64

func (*Producer) IsSame

func (producer *Producer) IsSame(brokerList []string, topic string) bool

func (*Producer) ProducerId

func (producer *Producer) ProducerId() uint8

func (*Producer) Serialize

func (producer *Producer) Serialize() ([]byte, error)

func (*Producer) SetHasSend

func (producer *Producer) SetHasSend(hasSend uint64)

func (*Producer) Start

func (producer *Producer) Start() error

func (*Producer) Status

func (producer *Producer) Status() int

func (*Producer) Stop

func (producer *Producer) Stop()

func (*Producer) Topic

func (producer *Producer) Topic() string

Jump to

Keyboard shortcuts

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