msgqueue

package
v0.0.16-bugfix Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagBrokers       = "brokers"
	FlagTopics        = "subscribe-modules"
	FlagFeatureToggle = "feature-toggle"
	KafkaPubTopic     = "coinex-dex"
)
View Source
const (
	CfgPrefixFile  = "file:"
	CfgPrefixKafka = "kafka:"
	CfgPrefixOS    = "os:"
)
View Source
const RetryNum = math.MaxInt64

Variables

View Source
var (
	EventTypeMsgQueue = "kafka"
)

Functions

func Retry added in v0.0.16

func Retry(attempts int, sleep time.Duration, fn func() error) error

Types

type MsgSender

type MsgSender interface {
	SendMsg(key []byte, v []byte)
	IsSubscribed(topic string) bool
	IsOpenToggle() bool
	GetMode() []string
	Close()
}

func NewProducer

func NewProducer(log log.Logger) MsgSender

func NewProducerFromConfig added in v0.0.15

func NewProducerFromConfig(brokers []string, topics string, featureToggle bool, log log.Logger) MsgSender

type MsgWriter added in v0.0.15

type MsgWriter interface {
	WriteKV(k, v []byte) error
	Close() error
	String() string
}

func NewFileMsgWriter added in v0.0.15

func NewFileMsgWriter(filePath string) (MsgWriter, error)

func NewKafkaMsgWriter added in v0.0.15

func NewKafkaMsgWriter(brokers string) (MsgWriter, error)

func NewNopMsgWriter added in v0.0.15

func NewNopMsgWriter() MsgWriter

func NewStdOutMsgWriter added in v0.0.15

func NewStdOutMsgWriter() MsgWriter

Jump to

Keyboard shortcuts

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