kafkaHelper

package
v1.4.1-rc-137 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: GPL-2.0 Imports: 9 Imported by: 7

Documentation

Index

Constants

View Source
const (
	TopicIndexBlock = 0

	TopicFiltersBlock = 1
	TopicTrades       = 2
	TopicTradesBlock  = 3

	TopicFiltersBlockHistorical = 4
	TopicTradesHistorical       = 5
	TopicTradesBlockHistorical  = 6

	TopicTradesEstimation = 7

	TopicFiltersBlockDone = 14

	TopicOptionOrderBook = 13
)

Variables

This section is empty.

Functions

func GetElements

func GetElements(topic int, offset int64, nbElements int) ([]interface{}, error)

func GetLastElement

func GetLastElement(topic int) (interface{}, error)

func GetLastElementWithRetryOnError

func GetLastElementWithRetryOnError(topic int) interface{}

func GetTopic

func GetTopic(topic int) string

func IsTopicEmpty

func IsTopicEmpty(topic int) bool

func NewReader

func NewReader(topic int) *kafka.Reader

func NewReaderNextMessage

func NewReaderNextMessage(topic int) *kafka.Reader

func NewReaderXElementsBeforeLastMessage

func NewReaderXElementsBeforeLastMessage(topic int, x int64) *kafka.Reader

func NewSyncWriter

func NewSyncWriter(topic int) *kafka.Writer

func NewWriter

func NewWriter(topic int) *kafka.Writer

func ReadOffset

func ReadOffset(topic int) (offset int64, err error)

WithRetryOnError

func ReadOffsetWithRetryOnError

func ReadOffsetWithRetryOnError(topic int) (offset int64)

func WriteMessage

func WriteMessage(w *kafka.Writer, m KafkaMessage) error

Types

type Config

type Config struct {
	KafkaUrl []string
}
var KafkaConfig Config

type KafkaMessage

type KafkaMessage interface {
	MarshalBinary() ([]byte, error)
}

type KafkaMessageWithAHash

type KafkaMessageWithAHash interface {
	Hash() string
}

Jump to

Keyboard shortcuts

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