Documentation ¶
Index ¶
- Constants
- Variables
- type AssignmentReq
- type AssignmentResp
- type CommitOffsetReq
- type CommitOffsetResp
- type CommitReq
- type CommitResp
- type CommittedReq
- type CommittedResp
- type Consumer
- func (c *Consumer) Assignment() (partitions []tmq.TopicPartition, err error)
- func (c *Consumer) Close() error
- func (c *Consumer) Commit() ([]tmq.TopicPartition, error)
- func (c *Consumer) CommitOffsets(offsets []tmq.TopicPartition) ([]tmq.TopicPartition, error)
- func (c *Consumer) Committed(partitions []tmq.TopicPartition, timeoutMs int) (offsets []tmq.TopicPartition, err error)
- func (c *Consumer) Poll(timeoutMs int) tmq.Event
- func (c *Consumer) Position(partitions []tmq.TopicPartition) (offsets []tmq.TopicPartition, err error)
- func (c *Consumer) Seek(partition tmq.TopicPartition, ignoredTimeoutMs int) error
- func (c *Consumer) Subscribe(topic string, rebalanceCb RebalanceCb) error
- func (c *Consumer) SubscribeTopics(topics []string, rebalanceCb RebalanceCb) error
- func (c *Consumer) Unsubscribe() error
- type FetchBlockReq
- type FetchJsonMetaReq
- type FetchJsonMetaResp
- type FetchReq
- type FetchResp
- type IndexedChan
- type OffsetSeekReq
- type OffsetSeekResp
- type PollReq
- type PollResp
- type PositionReq
- type PositionResp
- type RebalanceCb
- type SubscribeReq
- type SubscribeResp
- type TMQFetchRawMetaReq
- type TopicVgroupID
- type UnsubscribeReq
- type UnsubscribeResp
- type WSError
Constants ¶
View Source
const ( TMQSubscribe = "subscribe" TMQPoll = "poll" TMQFetchRaw = "fetch_raw" TMQFetchJsonMeta = "fetch_json_meta" TMQCommit = "commit" TMQUnsubscribe = "unsubscribe" TMQGetTopicAssignment = "assignment" TMQSeek = "seek" TMQCommitOffset = "commit_offset" TMQCommitted = "committed" TMQPosition = "position" )
Variables ¶
View Source
var ClosedErr = errors.New("connection closed")
Functions ¶
This section is empty.
Types ¶
type AssignmentReq ¶
type AssignmentResp ¶
type CommitOffsetReq ¶
type CommitOffsetResp ¶
type CommitResp ¶
type CommittedReq ¶
type CommittedReq struct { ReqID uint64 `json:"req_id"` TopicVgroupIDs []TopicVgroupID `json:"topic_vgroup_ids"` }
type CommittedResp ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
func NewConsumer ¶
NewConsumer create a tmq consumer
func (*Consumer) Assignment ¶
func (c *Consumer) Assignment() (partitions []tmq.TopicPartition, err error)
func (*Consumer) CommitOffsets ¶
func (c *Consumer) CommitOffsets(offsets []tmq.TopicPartition) ([]tmq.TopicPartition, error)
func (*Consumer) Committed ¶
func (c *Consumer) Committed(partitions []tmq.TopicPartition, timeoutMs int) (offsets []tmq.TopicPartition, err error)
func (*Consumer) Position ¶
func (c *Consumer) Position(partitions []tmq.TopicPartition) (offsets []tmq.TopicPartition, err error)
func (*Consumer) Seek ¶
func (c *Consumer) Seek(partition tmq.TopicPartition, ignoredTimeoutMs int) error
func (*Consumer) Subscribe ¶
func (c *Consumer) Subscribe(topic string, rebalanceCb RebalanceCb) error
func (*Consumer) SubscribeTopics ¶
func (c *Consumer) SubscribeTopics(topics []string, rebalanceCb RebalanceCb) error
func (*Consumer) Unsubscribe ¶
type FetchBlockReq ¶
type FetchJsonMetaReq ¶
type FetchJsonMetaResp ¶
type FetchResp ¶
type FetchResp struct { Code int `json:"code"` Message string `json:"message"` Action string `json:"action"` ReqID uint64 `json:"req_id"` Timing int64 `json:"timing"` MessageID uint64 `json:"message_id"` Completed bool `json:"completed"` TableName string `json:"table_name"` Rows int `json:"rows"` FieldsCount int `json:"fields_count"` FieldsNames []string `json:"fields_names"` FieldsTypes []uint8 `json:"fields_types"` FieldsLengths []int64 `json:"fields_lengths"` Precision int `json:"precision"` }
type IndexedChan ¶
type IndexedChan struct {
// contains filtered or unexported fields
}
type OffsetSeekReq ¶
type OffsetSeekResp ¶
type PollResp ¶
type PollResp struct { Code int `json:"code"` Message string `json:"message"` Action string `json:"action"` ReqID uint64 `json:"req_id"` Timing int64 `json:"timing"` HaveMessage bool `json:"have_message"` Topic string `json:"topic"` Database string `json:"database"` VgroupID int32 `json:"vgroup_id"` MessageType int32 `json:"message_type"` MessageID uint64 `json:"message_id"` Offset int64 `json:"offset"` }
type PositionReq ¶
type PositionReq struct { ReqID uint64 `json:"req_id"` TopicVgroupIDs []TopicVgroupID `json:"topic_vgroup_ids"` }
type PositionResp ¶
type SubscribeReq ¶
type SubscribeReq struct { ReqID uint64 `json:"req_id"` User string `json:"user"` Password string `json:"password"` DB string `json:"db"` GroupID string `json:"group_id"` ClientID string `json:"client_id"` OffsetRest string `json:"offset_rest"` Topics []string `json:"topics"` AutoCommit string `json:"auto_commit"` AutoCommitIntervalMS string `json:"auto_commit_interval_ms"` SnapshotEnable string `json:"snapshot_enable"` WithTableName string `json:"with_table_name"` }
type SubscribeResp ¶
type TMQFetchRawMetaReq ¶
type TopicVgroupID ¶
type UnsubscribeReq ¶
type UnsubscribeReq struct {
ReqID uint64 `json:"req_id"`
}
type UnsubscribeResp ¶
Click to show internal directories.
Click to hide internal directories.