consumer

package
v1.22.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HEX    = "hex"
	BASE64 = "base64"
	NONE   = "none"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AvroMessageDeserializer

type AvroMessageDeserializer struct {
	// contains filtered or unexported fields
}

func CreateAvroMessageDeserializer

func CreateAvroMessageDeserializer(topic string, avroSchemaRegistry string) (AvroMessageDeserializer, error)

func (AvroMessageDeserializer) CanDeserialize

func (deserializer AvroMessageDeserializer) CanDeserialize(topic string) (bool, error)

func (AvroMessageDeserializer) Deserialize

func (deserializer AvroMessageDeserializer) Deserialize(rawMsg *sarama.ConsumerMessage, flags ConsumerFlags) error

type CachingSchemaRegistry added in v1.17.0

type CachingSchemaRegistry struct {
	// contains filtered or unexported fields
}

func CreateCachingSchemaRegistry added in v1.17.0

func CreateCachingSchemaRegistry(avroSchemaRegistry string) (*CachingSchemaRegistry, error)

func (*CachingSchemaRegistry) GetSchemaByID added in v1.17.0

func (registry *CachingSchemaRegistry) GetSchemaByID(id int) (string, error)

func (*CachingSchemaRegistry) Subjects added in v1.17.0

func (registry *CachingSchemaRegistry) Subjects() ([]string, error)

type ConsumedMessage

type ConsumedMessage struct {
	Partition int32
	Offset    int64
	Key       []byte
	Value     []byte
	Timestamp *time.Time
}

type ConsumerFlags

type ConsumerFlags struct {
	PrintKeys       bool
	PrintTimestamps bool
	PrintAvroSchema bool
	PrintHeaders    bool
	OutputFormat    string
	Separator       string
	Partitions      []int
	Offsets         []string
	FromBeginning   bool
	Tail            int
	Exit            bool
	EncodeValue     string
	EncodeKey       string
}

type ConsumerOperation

type ConsumerOperation struct {
}

func (*ConsumerOperation) Consume

func (operation *ConsumerOperation) Consume(topic string, flags ConsumerFlags) error

type DefaultMessageDeserializer

type DefaultMessageDeserializer struct {
}

func (DefaultMessageDeserializer) CanDeserialize

func (deserializer DefaultMessageDeserializer) CanDeserialize(_ string) (bool, error)

func (DefaultMessageDeserializer) Deserialize

func (deserializer DefaultMessageDeserializer) Deserialize(rawMsg *sarama.ConsumerMessage, flags ConsumerFlags) error

type MessageDeserializer

type MessageDeserializer interface {
	CanDeserialize(topic string) (bool, error)
	Deserialize(msg *sarama.ConsumerMessage, flags ConsumerFlags) error
}

Jump to

Keyboard shortcuts

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