Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kafka ¶
func (*Kafka) OpenSubscription ¶
func (k *Kafka) OpenSubscription(group string, topics ...string) (*Subscription, error)
type MessageHeader ¶
type MessageHeader struct { ID string `json:"id"` Topic string `json:"topic"` Source string `json:"source"` // source system (clientIdPrefix prefix from config) Producer string `json:"producer"` // SaramaCfg.ClientID }
func (MessageHeader) CreatedAt ¶
func (m MessageHeader) CreatedAt() time.Time
func (MessageHeader) Xid ¶
func (m MessageHeader) Xid() xid.ID
type ReceivedMessage ¶
type ReceivedMessage struct { MessageHeader *pubsub.Message }
type Subscription ¶
type Subscription struct { PubsubSubscription *pubsub.Subscription // contains filtered or unexported fields }
func (*Subscription) Close ¶
func (t *Subscription) Close() error
func (*Subscription) ReceiveJSON ¶
func (t *Subscription) ReceiveJSON(ctx context.Context, dest interface{}) (*ReceivedMessage, error)
ReceiveJSON (blocking) and unmarshal from JSON a next message from subscription into 'dest' that must be a pointer. The Ack method of the returned ReceivedMessage must be called once the message has been processed, to prevent it from being received again.
func (*Subscription) ReceiveProtobuf ¶
func (t *Subscription) ReceiveProtobuf(ctx context.Context, dest proto.Message) (*ReceivedMessage, error)
ReceiveProtobuf (blocking) and unmarshal from proto a next message from subscription into 'dest' that must be a pointer. The Ack method of the returned ReceivedMessage must be called once the message has been processed, to prevent it from being received again.
Click to show internal directories.
Click to hide internal directories.