sender

package
v0.0.3-tmp Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2018 License: GPL-3.0 Imports: 15 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)
	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) 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()

type MqAccountBlock

type MqAccountBlock struct {
	ledger.AccountBlock
	Balance *big.Int
}

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) IsSame

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

func (*Producer) Serialize

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

func (*Producer) Start

func (producer *Producer) Start() error

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