types

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoopLogger = &noopLogger{}

A logger that does not output information

View Source
var StdLogger = &stdLogger{}

A logger using golang's builtin log.Printf() method, prefixed with the level

Functions

This section is empty.

Types

type BrokerError

type BrokerError interface {
	error

	// The ordinal of the broker for the error
	BrokerOrdinal() int
}

An error that includes the origin of the error

type ConsumerCommitResult

type ConsumerCommitResult struct {
	// The amount of errors with the origin
	Errors []BrokerError

	// The number of manual commit requests that succeeded
	SuccessCount int
}

Represents the result of a manual commit operations to all brokers in the cluster.

type ConsumerOptions

type ConsumerOptions struct {
	Group           string   // The consumer group
	Id              string   // A unique identifier for the consumer. When not set a random identifier will be generated.
	Topics          []string // The topics to subscribe to
	MaxPollInterval time.Duration
	Logger          Logger // The logger for the consumer to output the log messages
}

Represents the options for creating a Consumer.

type ConsumerPollResult

type ConsumerPollResult struct {
	TopicRecords []TopicRecords
	Error        error
}

Represents the result of a poll operation.

type GenVersion

type GenVersion uint32

Generation version

func (GenVersion) String

func (v GenVersion) String() string

type Logger

type Logger interface {
	Debug(format string, a ...interface{})
	Info(format string, a ...interface{})
	Warn(format string, a ...interface{})
	Error(format string, a ...interface{})
}

The logger to be used by the client to output log messages

type ProducerOptions

type ProducerOptions struct {
	// The logger for the producer to output internal log messages
	Logger Logger

	// The amount of bytes to coalesce internally before flushing the frames to the TCP connection (defaults to 16 KiB)
	FlushThresholdBytes int

	// The amount of persistent connections to maintain per broker (defaults to 1)
	ConnectionsPerBroker int
}

Represents the additional options to set when creating a Producer.

type RangeIndex

type RangeIndex uint8

Represents an index within a token range

func (RangeIndex) String

func (t RangeIndex) String() string

type Record

type Record struct {
	Timestamp time.Time
	Offset    int64
	Body      []byte
}

Represents a data record from a topic.

type Token

type Token int64

Represents a partition token

func (Token) String

func (t Token) String() string

type TopicDataId

type TopicDataId struct {
	Name       string     `json:"topic"`
	Token      Token      `json:"token"`
	RangeIndex RangeIndex `json:"rangeIndex"`
	Version    GenVersion `json:"version"`
}

TopicDataId contains information to locate a certain piece of data.

Specifies a topic, for a token, for a defined gen id.

func (*TopicDataId) String

func (t *TopicDataId) String() string

type TopicRecords

type TopicRecords struct {
	Topic   *TopicDataId
	Records []Record
}

Represents a set of records of a topic.

Jump to

Keyboard shortcuts

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