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 ¶ added in v3.5.0
type AssignmentResp ¶ added in v3.5.0
type CommitOffsetReq ¶ added in v3.5.1
type CommitOffsetResp ¶ added in v3.5.1
type CommitResp ¶
type CommittedReq ¶ added in v3.5.1
type CommittedReq struct { ReqID uint64 `json:"req_id"` TopicVgroupIDs []TopicVgroupID `json:"topic_vgroup_ids"` }
type CommittedResp ¶ added in v3.5.1
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
func NewConsumer ¶
NewConsumer create a tmq consumer
func (*Consumer) Assignment ¶ added in v3.5.0
func (c *Consumer) Assignment() (partitions []tmq.TopicPartition, err error)
func (*Consumer) CommitOffsets ¶ added in v3.5.1
func (c *Consumer) CommitOffsets(offsets []tmq.TopicPartition) ([]tmq.TopicPartition, error)
func (*Consumer) Committed ¶ added in v3.5.1
func (c *Consumer) Committed(partitions []tmq.TopicPartition, timeoutMs int) (offsets []tmq.TopicPartition, err error)
func (*Consumer) Position ¶ added in v3.5.1
func (c *Consumer) Position(partitions []tmq.TopicPartition) (offsets []tmq.TopicPartition, err error)
func (*Consumer) Seek ¶ added in v3.5.0
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 ¶ added in v3.1.0
func (c *Consumer) SubscribeTopics(topics []string, rebalanceCb RebalanceCb) error
func (*Consumer) Unsubscribe ¶ added in v3.1.0
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 ¶ added in v3.5.0
type OffsetSeekResp ¶ added in v3.5.0
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 ¶ added in v3.5.1
type PositionReq struct { ReqID uint64 `json:"req_id"` TopicVgroupIDs []TopicVgroupID `json:"topic_vgroup_ids"` }
type PositionResp ¶ added in v3.5.1
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 ¶ added in v3.5.2
type TopicVgroupID ¶ added in v3.5.1
type UnsubscribeReq ¶ added in v3.3.1
type UnsubscribeReq struct {
ReqID uint64 `json:"req_id"`
}
type UnsubscribeResp ¶ added in v3.3.1
Click to show internal directories.
Click to hide internal directories.