internal

package
v0.0.0-...-63b1974 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2017 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a Google Pub/Sub client.

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient creates a new PubSub client.

func (*Client) Ack

func (c *Client) Ack(ctx context.Context, project, subscription string, ids ...string) error

Ack acknowledges message receipt.

func (*Client) Extend

func (c *Client) Extend(ctx context.Context, project, subscription string, id string, deadline int) error

Extend extends the acknowledgement deadline for a specific message.

func (*Client) Publish

func (c *Client) Publish(ctx context.Context, project, topic string, messages ...Message) ([]string, error)

Publish publishes the supplied Messages to the topic.

func (*Client) Pull

func (c *Client) Pull(ctx context.Context, project, subscription string, max int) ([]Message, error)

Pull pulls a maximum number of N Messages for the subscription.

type Error

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Status  string `json:"status"`
}

Error represents a pubsub error message.

func (*Error) Error

func (e *Error) Error() string

Error returns the error message in string format.

type Message

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL