Documentation
¶
Index ¶
- Constants
- type KafkaInput
- func (in *KafkaInput) Close() error
- func (in *KafkaInput) Init(config transport.Configer) error
- func (in *KafkaInput) Read(p []byte) (cnt int, err error)
- func (in *KafkaInput) ReadFromTopic(topic string)
- func (in *KafkaInput) ReadWithGroup() error
- func (in *KafkaInput) Start() error
- func (in *KafkaInput) Version() string
Constants ¶
View Source
const (
VERSION = "0.0.1"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KafkaInput ¶
type KafkaInput struct { Addrs []string `json:"addrs"` //如果定义了group,则addrs是zookeeper的地址(2181),否则的话是kafka的地址(9092) Topics []string `json:"topics"` Group string `json:"group"` Offset int64 `json:"offset"` Message chan []byte //从这个管道中读取数据 }
一些使用说明: sarame.OffsetNewest int64 = -1 sarame.OffsetOldest int64 = -2
func NewKafkaInput ¶
func NewKafkaInput() *KafkaInput
func (*KafkaInput) Close ¶
func (in *KafkaInput) Close() error
func (*KafkaInput) Start ¶
func (in *KafkaInput) Start() error
func (*KafkaInput) Version ¶
func (in *KafkaInput) Version() string
Click to show internal directories.
Click to hide internal directories.