Documentation ¶
Index ¶
- type AckMessage
- type Client
- func (c *Client) Ack(ctx context.Context, subscription, ackID string) error
- func (c *Client) Publish(ctx context.Context, topic string, messages []*Message) error
- func (c *Client) PublishOne(ctx context.Context, topic string, message *Message) error
- func (c *Client) Pull(ctx context.Context, subscription string) (*ReceivedMessage, error)
- func (c *Client) PullAndAck(ctx context.Context, subscription string) (*Message, error)
- type Message
- type Messages
- type ReceivedMessage
- type ReceivedMessages
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AckMessage ¶
type AckMessage struct {
AckIDs []string `json:"ackIds"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
NewClient creates a new authenticated http client using Google's Application Default Credentials.
func (*Client) Publish ¶
Publish pushes new messages onto the provided topic, returning any errors that occur.
func (*Client) PublishOne ¶
PublishOne pushes a new message onto the provided topic, returning any errors that occur.
type Message ¶
type Message struct { // Data is the message data. Data []byte `json:"data"` // Attributes are any message attributes. Attributes map[string]string `json:"attributes"` // MessageID is assigned by the server. MessageID string `json:"messageId"` // PublishTime is the server timestamp for when the message was published. PublishTime *time.Time `json:"publishTime"` }
Message represents a message on the PubSub topic/subscription.
type ReceivedMessage ¶
ReceivedMessage is a message received back from PubSub.
type ReceivedMessages ¶
type ReceivedMessages struct {
ReceivedMessages []*ReceivedMessage `json:"receivedMessages"`
}
Click to show internal directories.
Click to hide internal directories.