kafkaHelper

package
v1.4.482 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: GPL-2.0 Imports: 11 Imported by: 7

Documentation

Index

Constants

View Source
const (
	TopicIndexBlock = 0

	TopicFiltersBlock = 1
	TopicTrades       = 2
	TopicTradesBlock  = 3

	// The replica topics can be used to forward trades and blocks to other services in parallel.
	TopicFiltersBlockReplica = 4
	TopicTradesReplica       = 5
	TopicTradesBlockReplica  = 6

	TopicTradesEstimation = 7

	TopicFiltersBlockDone = 14

	TopicFiltersBlockTest = 21
	TopicTradesTest       = 22
	TopicTradesBlockTest  = 23
	TopicNFTTrades        = 24
	TopicNFTTradesTest    = 25
)

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 NewSyncWriterWithCompression added in v1.4.6

func NewSyncWriterWithCompression(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