kafkaHelper

package
v0.0.0-...-3beb7e2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TopicIndexBlock      = 0
	TopicFiltersBlock    = 1
	TopicTrades          = 2
	TopicTradesBlock     = 3
	TopicSuppliesBlock   = 7
	TopicIndexBlock2     = 8
	TopicIndexBlockDaily = 11

	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) (int64, 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