package
Version:
v0.0.0-...-e6824c6
Opens a new window with list of versions in this module.
Published: Apr 9, 2017
License: BSD-3-Clause
Opens a new window with license information.
Imports: 8
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
-
type Client
-
func (c *Client) Ack(ctx context.Context, project, subscription string, ids ...string) error
-
func (c *Client) Publish(ctx context.Context, project, topic string, messages ...Message) ([]string, error)
-
func (c *Client) Pull(ctx context.Context, project, subscription string, max int) ([]Message, error)
-
type Error
-
type Message
Client is a Google Pub/Sub client.
NewClient creates a new PubSub client.
Ack acknowledges message receipt.
Publish publishes the supplied Messages to the topic.
Pull pulls a maximum number of N Messages for the subscription.
type Error struct {
Code int `json:"code"`
Message string `json:"message"`
Status string `json:"status"`
}
Error represents a pubsub error message.
Error returns the error message in string format.
type Message struct {
MessageID string `json:"messageId"`
AckID string `json:"-"`
Data []byte `json:"data"`
PublishTime time.Time `json:"publishTime"`
Attributes map[string]string `json:"attributes"`
}
Message represents a pubsub message.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.