kafka

package
v2.4.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

copied from https://github.com/Shopify/sarama/blob/44627b731c60bb90efe25573e7ef2b3f8df3fa23/examples/sasl_scram_client/scram_client.go

View Source
var TopicPollInterval = 30 * time.Second

Functions

This section is empty.

Types

type ConsumerDetails

type ConsumerDetails struct {

	// MemberID returns the cluster member ID.
	MemberID string

	// GenerationID returns the current generation ID.
	GenerationID int32

	Topic         string
	Partition     int32
	InitialOffset int64
}

func (ConsumerDetails) String

func (c ConsumerDetails) String() string

type RunnableTarget

type RunnableTarget interface {
	target.Target
	// contains filtered or unexported methods
}

type Target

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

func NewTarget

func NewTarget(
	session sarama.ConsumerGroupSession,
	claim sarama.ConsumerGroupClaim,
	discoveredLabels, lbs model.LabelSet,
	relabelConfig []*relabel.Config,
	client api.EntryHandler,
	useIncomingTimestamp bool,
) *Target

func (*Target) Details

func (t *Target) Details() interface{}

Details returns target-specific details.

func (*Target) DiscoveredLabels

func (t *Target) DiscoveredLabels() model.LabelSet

func (*Target) Labels

func (t *Target) Labels() model.LabelSet

func (*Target) Ready

func (t *Target) Ready() bool

func (*Target) Type

func (t *Target) Type() target.TargetType

type TargetDiscoverer

type TargetDiscoverer interface {
	NewTarget(sarama.ConsumerGroupSession, sarama.ConsumerGroupClaim) (RunnableTarget, error)
}

type TargetManager

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

TargetManager manages a series of kafka targets.

func NewTargetManager

func NewTargetManager(
	reg prometheus.Registerer,
	logger log.Logger,
	pushClient api.EntryHandler,
	scrapeConfigs []scrapeconfig.Config,
) (*TargetManager, error)

NewTargetManager creates a new Kafka managers.

func (*TargetManager) ActiveTargets

func (tm *TargetManager) ActiveTargets() map[string][]target.Target

func (*TargetManager) AllTargets

func (tm *TargetManager) AllTargets() map[string][]target.Target

func (*TargetManager) Ready

func (tm *TargetManager) Ready() bool

Ready returns true if at least one Kafka target is active.

func (*TargetManager) Stop

func (tm *TargetManager) Stop()

type TargetSyncer

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

func NewSyncer

func NewSyncer(
	reg prometheus.Registerer,
	logger log.Logger,
	cfg scrapeconfig.Config,
	pushClient api.EntryHandler,
) (*TargetSyncer, error)

func (*TargetSyncer) Cleanup

func (c *TargetSyncer) Cleanup(sarama.ConsumerGroupSession) error

Cleanup is run at the end of a session, once all ConsumeClaim goroutines have exited

func (*TargetSyncer) ConsumeClaim

func (c *TargetSyncer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error

ConsumeClaim creates a target for the given received claim and start reading message from it.

func (*TargetSyncer) NewTarget

NewTarget creates a new targets based on the current kafka claim and group session.

func (*TargetSyncer) Setup

func (c *TargetSyncer) Setup(session sarama.ConsumerGroupSession) error

Setup is run at the beginning of a new session, before ConsumeClaim

func (*TargetSyncer) Stop

func (ts *TargetSyncer) Stop() error

type TopicManager

type TopicManager interface {
	Topics() ([]string, error)
}

type XDGSCRAMClient

type XDGSCRAMClient struct {
	*scram.Client
	*scram.ClientConversation
	scram.HashGeneratorFcn
}

XDGSCRAMClient implements sarama.SCRAMClient

func (*XDGSCRAMClient) Begin

func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error)

func (*XDGSCRAMClient) Done

func (x *XDGSCRAMClient) Done() bool

func (*XDGSCRAMClient) Step

func (x *XDGSCRAMClient) Step(challenge string) (response string, err error)

Jump to

Keyboard shortcuts

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