Documentation ¶
Index ¶
- func SetTrace(t bool)
- type ClientReader
- type ClientWriter
- type Clientkafka
- func (client *Clientkafka) CreateTopic(topic string) error
- func (client *Clientkafka) Host() string
- func (client *Clientkafka) Kafka() *kafka.Conn
- func (client *Clientkafka) ListTopics() []string
- func (client *Clientkafka) NewReader(topic string) *ClientReader
- func (client *Clientkafka) NewWriter(topic string) *ClientWriter
- type Config
- type Proxy
- type Reader
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 (*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 (*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 设置组
Click to show internal directories.
Click to hide internal directories.