kgox

package
v0.0.69 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultMarshaler

type DefaultMarshaler struct{}

func (*DefaultMarshaler) Marshal

func (m *DefaultMarshaler) Marshal(msg *messagex.Message, topic string) (*kgo.Record, error)

func (*DefaultMarshaler) Unmarshal

func (m *DefaultMarshaler) Unmarshal(r *kgo.Record) (*messagex.Message, error)

Unmarshal implements Unmarshaler.

type KgoxAdminClient added in v0.0.68

type KgoxAdminClient struct {
	*kadm.Client
	// contains filtered or unexported fields
}

func NewPubSubAdminClient added in v0.0.68

func NewPubSubAdminClient(cl *kadm.Client, defaultCreateTopicConfigEntries map[string]*string) *KgoxAdminClient

func (*KgoxAdminClient) CreateTopic added in v0.0.68

func (p *KgoxAdminClient) CreateTopic(ctx context.Context, partitions int32, replicationFactor int16, topic string, configs ...map[string]*string) (kadm.CreateTopicResponse, error)

CreateTopic implements PubSubAdminClient. Subtle: this method shadows the method (*Client).CreateTopic of pubsubAdminClient.Client.

func (*KgoxAdminClient) HealthCheck added in v0.0.68

func (p *KgoxAdminClient) HealthCheck(ctx context.Context) error

HealthCheck implements pubsubx.PubSubAdminClient.

type Marshaler

type Marshaler interface {
	// Marshal marshals a message into a Kafka record.
	Marshal(m *messagex.Message, topic string) (*kgo.Record, error)
}

type PubSub

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

func NewPubSub

func NewPubSub(l *logrusx.Logger, config *pubsubx.Config, opts *pubsubx.PubSubOptions) (*PubSub, error)

func (*PubSub) AdminClient added in v0.0.68

func (p *PubSub) AdminClient() (pubsubx.PubSubAdminClient, error)

AdminClient implements pubsubx.PubSub.

func (*PubSub) Close

func (p *PubSub) Close() error

Close implements pubsubx.PubSub.

func (*PubSub) Publisher

func (p *PubSub) Publisher() pubsubx.Publisher

Publisher implements pubsubx.PubSub.

func (*PubSub) Subscriber

func (p *PubSub) Subscriber(group string, topics []messagex.Topic, opts ...pubsubx.SubscriberOption) (pubsubx.Subscriber, error)

Subscriber implements pubsubx.PubSub.

type Unmarshaler

type Unmarshaler interface {
	// Unmarshal unmarshals a Kafka record into a message.
	Unmarshal(r *kgo.Record) (*messagex.Message, error)
}

Jump to

Keyboard shortcuts

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