Documentation ¶
Index ¶
- Constants
- Variables
- func KafkaAdmin(kafkaPorts []string, config *sarama.Config) sarama.ClusterAdmin
- func NewConsumerGroup(kafkaPorts []string, groupID string, config *sarama.Config) sarama.ConsumerGroup
- func NewProducer(kafkaPorts []string, config *sarama.Config) sarama.SyncProducer
- func ProducerDeliverMessage(msgBytes []byte, topic string, producer sarama.SyncProducer) error
- func SaramaConfig() *sarama.Config
- func TopicsInit(admin sarama.ClusterAdmin, topic string, topicDetail sarama.TopicDetail)
- type KafkaState
Constants ¶
View Source
const EthUnbond = "ethereum-unbond" //flushes every 3 days
View Source
const GroupEthUnbond = "group-ethereum-unbond"
View Source
const GroupMsgDelegate = "group-msg-delegate"
View Source
const GroupMsgSend = "group-msg-send"
View Source
const GroupMsgUnbond = "group-msg-unbond"
View Source
const GroupRedelegate = "group-redelegate"
View Source
const GroupRetryTendermint = "group-retry-tendermint"
View Source
const GroupToEth = "group-to-ethereum"
View Source
const GroupToTendermint = "group-to-tendermint"
View Source
const MsgDelegate = "msg-delegate" //priority2
View Source
const MsgSend = "msg-send" //priority3
View Source
const MsgUnbond = "msg-unbond" //priority1
View Source
const Redelegate = "redelegate"
View Source
const RetryTendermint = "retry-tendermint"
View Source
const ToEth = "to-ethereum"
View Source
const ToTendermint = "to-tendermint"
Variables ¶
View Source
var Groups = []string{GroupEthUnbond, GroupMsgSend, GroupMsgDelegate, GroupRedelegate, GroupMsgUnbond, GroupToEth, GroupRetryTendermint, GroupToTendermint, }
View Source
var Topics = []string{ EthUnbond, MsgSend, MsgDelegate, Redelegate, MsgUnbond, ToEth, RetryTendermint, ToTendermint, }
Topics : is list of topics
Functions ¶
func KafkaAdmin ¶
func KafkaAdmin(kafkaPorts []string, config *sarama.Config) sarama.ClusterAdmin
KafkaAdmin : is admin to create topics
func NewConsumerGroup ¶
func NewProducer ¶
func NewProducer(kafkaPorts []string, config *sarama.Config) sarama.SyncProducer
NewProducer is a producer to send messages to kafka
func ProducerDeliverMessage ¶
func ProducerDeliverMessage(msgBytes []byte, topic string, producer sarama.SyncProducer) error
ProducerDeliverMessage : delivers messages to kafka
func SaramaConfig ¶
func TopicsInit ¶
func TopicsInit(admin sarama.ClusterAdmin, topic string, topicDetail sarama.TopicDetail)
TopicsInit : is needed to initialise topics
Types ¶
type KafkaState ¶
type KafkaState struct { HomeDir string Admin sarama.ClusterAdmin ConsumerGroup map[string]sarama.ConsumerGroup Producer sarama.SyncProducer Topics []string }
KafkaState : is a struct showing the state of kafka
func NewKafkaState ¶
func NewKafkaState(kafkaPorts []string, homeDir string, topicDetail sarama.TopicDetail) KafkaState
NewKafkaState : returns a kafka state
Click to show internal directories.
Click to hide internal directories.