kafka

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TopicCommentPublish      = "comment_publish"
	TopicCommentCacheRebuild = "comment_cache_rebuild"
	TopicCommentOperator     = "comment_operator"

	TopicRelationFollow       = "relation_follow"
	TopicRelationCacheRebuild = "relation_cache_rebuild"
	TopicRelationSyncCount    = "relation_sync_count"
	TopicRelationOperator     = "relation_operator"

	TopicOpusOperator = "opus_operator"
)

Variables

This section is empty.

Functions

func NewConsumer

func NewConsumer(conf *Config, topics []string, group string, fn mq.HandleFunc, opts ...mq.Option) (mq.Consumer, error)

Types

type Config

type Config struct {
	Addr []string `yaml:"addr"`
}

type Consumer

type Consumer struct {
	*mq.ConsumerMeta
	// contains filtered or unexported fields
}

func (*Consumer) Start

func (c *Consumer) Start() error

func (*Consumer) Stop

func (c *Consumer) Stop() error

type Dispatch added in v0.0.8

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

func NewDispatchConsumer added in v0.0.8

func NewDispatchConsumer(conf *Config, topics []string, group string, fn mq.HandleFunc, n int) (*Dispatch, error)

func (*Dispatch) Start added in v0.0.8

func (c *Dispatch) Start() error

func (*Dispatch) Stop added in v0.0.8

func (c *Dispatch) Stop() error

type Producer

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

func NewProducer

func NewProducer(conf *Config) (*Producer, error)

func (*Producer) Close

func (p *Producer) Close() error

func (*Producer) SendMessage

func (p *Producer) SendMessage(ctx context.Context, topic, key, tag string, msg proto.Message) error

Jump to

Keyboard shortcuts

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