ganyu

package module
v0.0.0-...-cb143e0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker interface {
	CreateTopic(ctx context.Context, topic domain.Topic) error
	Push(ctx context.Context, topic, payload, partitionKey string) error
}

func NewDefaultBroker

func NewDefaultBroker(cfg redisstorage.PoolOptions, opts ...Option) Broker

type BrokerOpts

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

type MQRepository

type MQRepository interface {
	Push(ctx context.Context, topic, payload string, partition int) error
	Pop(ctx context.Context, topic string, partition int) (string, error)
}

type Option

type Option func(opt *BrokerOpts)

type Producer

type Producer struct {
	Broker Broker
}

func NewProducer

func NewProducer(broker Broker) *Producer

func (*Producer) Produce

func (p *Producer) Produce(ctx context.Context, topic, message string, partitionKey string) error

type RepositorySet

type RepositorySet interface {
	TopicRepository
	MQRepository
}

type TopicRepository

type TopicRepository interface {
	CreateTopic(ctx context.Context, topic domain.Topic) error
	GetTopicPartitions(ctx context.Context, topic string) (int, error)
}

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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