msg

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Marker

type Marker[K, V any] chan Message[K, V]

Marker is used to mark a message as processed.

type Message

type Message[K, V any] interface {
	// Key is used to get the key of a message.
	Key() K

	// Value is used to get the value of a message.
	Mark()

	// Marked is used to check if a message has been marked as processed
	Marked() bool

	// Offset is used to get the offset of a message.
	Offset() int

	// Partition is used to get the partition of a message.
	Partition() int

	// SetKey is used to set the key of a message.
	SetKey(key K)

	// SetValue is used to set the value of a message.
	SetValue(val V)

	// Topic is used to get the topic of a message.
	Topic() string

	// SetTopic is used to set the topic of a message.
	SetTopic(topic string)

	// Value is used to get the value of a message.
	Value() V

	// Clone is used to clone a message.
	Clone() Message[K, V]
}

Message represents a message in a Stream

func NewMessage

func NewMessage[K, V any](key K, val V, offset int, partition int, topic string, mark Marker[K, V]) Message[K, V]

NewMessage creates a new Message.

type MessageImpl

type MessageImpl[K, V any] struct {
	sync.Mutex
	// contains filtered or unexported fields
}

MessageImpl is the default implementation of Message

func (*MessageImpl[K, V]) Clone

func (m *MessageImpl[K, V]) Clone() Message[K, V]

Clone is used to clone a message.

func (*MessageImpl[K, V]) Key

func (m *MessageImpl[K, V]) Key() K

Key is used to get the key of a message.

func (*MessageImpl[K, V]) Mark

func (m *MessageImpl[K, V]) Mark()

Mark is used to mark a message as processed

func (*MessageImpl[K, V]) Marked

func (m *MessageImpl[K, V]) Marked() bool

Marked is used to check if a message has been marked as processed

func (*MessageImpl[K, V]) Offset

func (m *MessageImpl[K, V]) Offset() int

Offset is used to get the offset of a message.

func (*MessageImpl[K, V]) Partition

func (m *MessageImpl[K, V]) Partition() int

Partition is used to get the partition of a message.

func (*MessageImpl[K, V]) SetKey

func (m *MessageImpl[K, V]) SetKey(key K)

SetKey is used to set the key of a message.

func (*MessageImpl[K, V]) SetTopic

func (m *MessageImpl[K, V]) SetTopic(topic string)

SetTopic is used to set the topic of a message.

func (*MessageImpl[K, V]) SetValue

func (m *MessageImpl[K, V]) SetValue(val V)

SetValue is used to set the value of a message.

func (*MessageImpl[K, V]) Topic

func (m *MessageImpl[K, V]) Topic() string

Topic is used to get the topic of a message.

func (*MessageImpl[K, V]) Value

func (m *MessageImpl[K, V]) Value() V

Value is used to get the value of a message.

Jump to

Keyboard shortcuts

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