kafka

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetTrace added in v1.3.3

func SetTrace(t bool)

Types

type ClientReader added in v1.3.3

type ClientReader struct {
	*kafka.Reader
}

func (*ClientReader) ReadMessage added in v1.3.3

func (cr *ClientReader) ReadMessage(ctx context.Context) (kafka.Message, error)

type ClientWriter added in v1.3.3

type ClientWriter struct {
	*kafka.Writer
}

func (*ClientWriter) SendMessage added in v1.3.3

func (cw *ClientWriter) SendMessage(ctx context.Context, msg ...kafka.Message) error

type Clientkafka added in v1.3.3

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

func New added in v1.3.3

func New(config *Config) *Clientkafka

New 新连接

func (*Clientkafka) CreateTopic added in v1.3.3

func (client *Clientkafka) CreateTopic(topic string) error

CreateTopic create

func (*Clientkafka) Host added in v1.3.3

func (client *Clientkafka) Host() string

func (*Clientkafka) Kafka added in v1.3.3

func (client *Clientkafka) Kafka() *kafka.Conn

func (*Clientkafka) ListTopics added in v1.3.3

func (client *Clientkafka) ListTopics() []string

ListTopics To list topics

func (*Clientkafka) NewReader added in v1.3.3

func (client *Clientkafka) NewReader(topic string) *ClientReader

func (*Clientkafka) NewWriter added in v1.3.3

func (client *Clientkafka) NewWriter(topic string) *ClientWriter

NewWriter ..

type Config added in v1.3.3

type Config struct {
	Username string //账号 root
	Password string //密码
	Host     string //host localhost
	Broker   []string
}

Config 数据库配置

type Proxy added in v1.3.3

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

Proxy 代理

func NewProxy added in v1.3.3

func NewProxy() *Proxy

NewProxy 代理池

func (*Proxy) NameSpace added in v1.3.3

func (proxy *Proxy) NameSpace(group string) *Clientkafka

NameSpace 获取分组

func (*Proxy) SetNameSpace added in v1.3.3

func (proxy *Proxy) SetNameSpace(group string, client *Clientkafka)

SetNameSpace 设置组

type Reader added in v1.3.3

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

func (*Reader) NameSpace added in v1.3.3

func (proxy *Reader) NameSpace(topic string) *ClientReader

NameSpace 获取分组

func (*Reader) SetNameSpace added in v1.3.3

func (proxy *Reader) SetNameSpace(group string, client *ClientReader)

SetNameSpace 设置组

type Writer added in v1.3.3

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

func (*Writer) NameSpace added in v1.3.3

func (proxy *Writer) NameSpace(topic string) *ClientWriter

NameSpace 获取分组

func (*Writer) SetNameSpace added in v1.3.3

func (proxy *Writer) SetNameSpace(group string, client *ClientWriter)

SetNameSpace 设置组

Jump to

Keyboard shortcuts

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