pubsub

package
v2.3.0-alpha+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2016 License: BSD-3-Clause, Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package pubsub provides access to the Google Cloud Pub/Sub API.

See https://cloud.google.com/pubsub/docs

Usage example:

import "google.golang.org/api/pubsub/v1beta1a"
...
pubsubService, err := pubsub.New(oauthHttpClient)

Index

Constants

View Source
const (
	// View and manage your data across Google Cloud Platform services
	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"

	// View and manage Pub/Sub topics and subscriptions
	PubsubScope = "https://www.googleapis.com/auth/pubsub"
)

OAuth2 scopes used by this API.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcknowledgeRequest

type AcknowledgeRequest struct {
	// AckId: The acknowledgment ID for the message being acknowledged. This
	// was returned by the Pub/Sub system in the Pull response.
	AckId []string `json:"ackId,omitempty"`

	// Subscription: The subscription whose message is being acknowledged.
	Subscription string `json:"subscription,omitempty"`

	// ForceSendFields is a list of field names (e.g. "AckId") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

AcknowledgeRequest: Request for the Acknowledge method.

func (*AcknowledgeRequest) MarshalJSON

func (s *AcknowledgeRequest) MarshalJSON() ([]byte, error)

type Empty

type Empty struct {
	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`
}

Empty: An empty message that you can re-use to avoid defining duplicated empty messages in your project. A typical example is to use it as argument or the return value of a service API. For instance: service Foo { rpc Bar (proto2.Empty) returns (proto2.Empty) { }; }; BEGIN GOOGLE-INTERNAL The difference between this one and net/rpc/empty-message.proto is that 1) The generated message here is in proto2 C++ API. 2) The proto2.Empty has minimum dependencies (no message_set or net/rpc dependencies) END GOOGLE-INTERNAL

type Label

type Label struct {
	// Key: The key of a label is a syntactically valid URL (as per RFC
	// 1738) with the "scheme" and initial slashes omitted and with the
	// additional restrictions noted below. Each key should be globally
	// unique. The "host" portion is called the "namespace" and is not
	// necessarily resolvable to a network endpoint. Instead, the namespace
	// indicates what system or entity defines the semantics of the label.
	// Namespaces do not restrict the set of objects to which a label may be
	// associated. Keys are defined by the following grammar: key = hostname
	// "/" kpath kpath = ksegment *[ "/" ksegment ] ksegment = alphadigit |
	// *[ alphadigit | "-" | "_" | "." ] where "hostname" and "alphadigit"
	// are defined as in RFC 1738. Example key: spanner.google.com/universe
	Key string `json:"key,omitempty"`

	// NumValue: An integer value.
	NumValue int64 `json:"numValue,omitempty,string"`

	// StrValue: A string value.
	StrValue string `json:"strValue,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Key") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

Label: A key-value pair applied to a given object.

func (*Label) MarshalJSON

func (s *Label) MarshalJSON() ([]byte, error)

type ListSubscriptionsResponse

type ListSubscriptionsResponse struct {
	// NextPageToken: If not empty, indicates that there are more
	// subscriptions that match the request and this value should be passed
	// to the next ListSubscriptionsRequest to continue.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// Subscription: The subscriptions that match the request.
	Subscription []*Subscription `json:"subscription,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

ListSubscriptionsResponse: Response for the ListSubscriptions method.

func (*ListSubscriptionsResponse) MarshalJSON

func (s *ListSubscriptionsResponse) MarshalJSON() ([]byte, error)

type ListTopicsResponse

type ListTopicsResponse struct {
	// NextPageToken: If not empty, indicates that there are more topics
	// that match the request, and this value should be passed to the next
	// ListTopicsRequest to continue.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// Topic: The resulting topics.
	Topic []*Topic `json:"topic,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

ListTopicsResponse: Response for the ListTopics method.

func (*ListTopicsResponse) MarshalJSON

func (s *ListTopicsResponse) MarshalJSON() ([]byte, error)

type ModifyAckDeadlineRequest

type ModifyAckDeadlineRequest struct {
	// AckDeadlineSeconds: The new ack deadline with respect to the time
	// this request was sent to the Pub/Sub system. Must be >= 0. For
	// example, if the value is 10, the new ack deadline will expire 10
	// seconds after the ModifyAckDeadline call was made. Specifying zero
	// may immediately make the message available for another pull request.
	AckDeadlineSeconds int64 `json:"ackDeadlineSeconds,omitempty"`

	// AckId: The acknowledgment ID. Either this or ack_ids must be
	// populated, not both.
	AckId string `json:"ackId,omitempty"`

	// AckIds: List of acknowledgment IDs. Either this field or ack_id
	// should be populated, not both.
	AckIds []string `json:"ackIds,omitempty"`

	// Subscription: Next Index: 5 The name of the subscription from which
	// messages are being pulled.
	Subscription string `json:"subscription,omitempty"`

	// ForceSendFields is a list of field names (e.g. "AckDeadlineSeconds")
	// to unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

ModifyAckDeadlineRequest: Request for the ModifyAckDeadline method.

func (*ModifyAckDeadlineRequest) MarshalJSON

func (s *ModifyAckDeadlineRequest) MarshalJSON() ([]byte, error)

type ModifyPushConfigRequest

type ModifyPushConfigRequest struct {
	// PushConfig: An empty push_config indicates that the Pub/Sub system
	// should pause pushing messages from the given subscription.
	PushConfig *PushConfig `json:"pushConfig,omitempty"`

	// Subscription: The name of the subscription.
	Subscription string `json:"subscription,omitempty"`

	// ForceSendFields is a list of field names (e.g. "PushConfig") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

ModifyPushConfigRequest: Request for the ModifyPushConfig method.

func (*ModifyPushConfigRequest) MarshalJSON

func (s *ModifyPushConfigRequest) MarshalJSON() ([]byte, error)

type PublishBatchRequest

type PublishBatchRequest struct {
	// Messages: The messages to publish.
	Messages []*PubsubMessage `json:"messages,omitempty"`

	// Topic: The messages in the request will be published on this topic.
	Topic string `json:"topic,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Messages") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

PublishBatchRequest: Request for the PublishBatch method.

func (*PublishBatchRequest) MarshalJSON

func (s *PublishBatchRequest) MarshalJSON() ([]byte, error)

type PublishBatchResponse

type PublishBatchResponse struct {
	// MessageIds: The server-assigned ID of each published message, in the
	// same order as the messages in the request. IDs are guaranteed to be
	// unique within the topic.
	MessageIds []string `json:"messageIds,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "MessageIds") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

PublishBatchResponse: Response for the PublishBatch method.

func (*PublishBatchResponse) MarshalJSON

func (s *PublishBatchResponse) MarshalJSON() ([]byte, error)

type PublishRequest

type PublishRequest struct {
	// Message: The message to publish.
	Message *PubsubMessage `json:"message,omitempty"`

	// Topic: The message in the request will be published on this topic.
	Topic string `json:"topic,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Message") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

PublishRequest: Request for the Publish method.

func (*PublishRequest) MarshalJSON

func (s *PublishRequest) MarshalJSON() ([]byte, error)

type PubsubEvent

type PubsubEvent struct {
	// Deleted: Indicates that this subscription has been deleted. (Note
	// that pull subscribers will always receive NOT_FOUND in response in
	// their pull request on the subscription, rather than seeing this
	// boolean.)
	Deleted bool `json:"deleted,omitempty"`

	// Message: A received message.
	Message *PubsubMessage `json:"message,omitempty"`

	// Subscription: The subscription that received the event.
	Subscription string `json:"subscription,omitempty"`

	// Truncated: Indicates that this subscription has been truncated.
	Truncated bool `json:"truncated,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Deleted") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

PubsubEvent: An event indicating a received message or truncation event.

func (*PubsubEvent) MarshalJSON

func (s *PubsubEvent) MarshalJSON() ([]byte, error)

type PubsubMessage

type PubsubMessage struct {
	// Data: The message payload.
	Data string `json:"data,omitempty"`

	// Label: Optional list of labels for this message. Keys in this
	// collection must be unique.
	Label []*Label `json:"label,omitempty"`

	// MessageId: ID of this message assigned by the server at publication
	// time. Guaranteed to be unique within the topic. This value may be
	// read by a subscriber that receives a PubsubMessage via a Pull call or
	// a push delivery. It must not be populated by a publisher in a Publish
	// call.
	MessageId string `json:"messageId,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Data") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

PubsubMessage: A message data and its labels.

func (*PubsubMessage) MarshalJSON

func (s *PubsubMessage) MarshalJSON() ([]byte, error)

type PullBatchRequest

type PullBatchRequest struct {
	// MaxEvents: The maximum number of PubsubEvents returned for this
	// request. The Pub/Sub system may return fewer than the number of
	// events specified.
	MaxEvents int64 `json:"maxEvents,omitempty"`

	// ReturnImmediately: If this is specified as true the system will
	// respond immediately even if it is not able to return a message in the
	// Pull response. Otherwise the system is allowed to wait until at least
	// one message is available rather than returning no messages. The
	// client may cancel the request if it does not wish to wait any longer
	// for the response.
	ReturnImmediately bool `json:"returnImmediately,omitempty"`

	// Subscription: The subscription from which messages should be pulled.
	Subscription string `json:"subscription,omitempty"`

	// ForceSendFields is a list of field names (e.g. "MaxEvents") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

PullBatchRequest: Request for the PullBatch method.

func (*PullBatchRequest) MarshalJSON

func (s *PullBatchRequest) MarshalJSON() ([]byte, error)

type PullBatchResponse

type PullBatchResponse struct {
	// PullResponses: Received Pub/Sub messages or status events. The
	// Pub/Sub system will return zero messages if there are no more
	// messages available in the backlog. The Pub/Sub system may return
	// fewer than the max_events requested even if there are more messages
	// available in the backlog.
	PullResponses []*PullResponse `json:"pullResponses,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "PullResponses") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

PullBatchResponse: Response for the PullBatch method.

func (*PullBatchResponse) MarshalJSON

func (s *PullBatchResponse) MarshalJSON() ([]byte, error)

type PullRequest

type PullRequest struct {
	// ReturnImmediately: If this is specified as true the system will
	// respond immediately even if it is not able to return a message in the
	// Pull response. Otherwise the system is allowed to wait until at least
	// one message is available rather than returning FAILED_PRECONDITION.
	// The client may cancel the request if it does not wish to wait any
	// longer for the response.
	ReturnImmediately bool `json:"returnImmediately,omitempty"`

	// Subscription: The subscription from which a message should be pulled.
	Subscription string `json:"subscription,omitempty"`

	// ForceSendFields is a list of field names (e.g. "ReturnImmediately")
	// to unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

PullRequest: Request for the Pull method.

func (*PullRequest) MarshalJSON

func (s *PullRequest) MarshalJSON() ([]byte, error)

type PullResponse

type PullResponse struct {
	// AckId: This ID must be used to acknowledge the received event or
	// message.
	AckId string `json:"ackId,omitempty"`

	// PubsubEvent: A pubsub message or truncation event.
	PubsubEvent *PubsubEvent `json:"pubsubEvent,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "AckId") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

PullResponse: Either a PubsubMessage or a truncation event. One of these two must be populated.

func (*PullResponse) MarshalJSON

func (s *PullResponse) MarshalJSON() ([]byte, error)

type PushConfig

type PushConfig struct {
	// PushEndpoint: A URL locating the endpoint to which messages should be
	// pushed. For example, a Webhook endpoint might use
	// "https://example.com/push".
	PushEndpoint string `json:"pushEndpoint,omitempty"`

	// ForceSendFields is a list of field names (e.g. "PushEndpoint") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

PushConfig: Configuration for a push delivery endpoint.

func (*PushConfig) MarshalJSON

func (s *PushConfig) MarshalJSON() ([]byte, error)

type Service

type Service struct {
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	Subscriptions *SubscriptionsService

	Topics *TopicsService
	// contains filtered or unexported fields
}

func New

func New(client *http.Client) (*Service, error)

type Subscription

type Subscription struct {
	// AckDeadlineSeconds: For either push or pull delivery, the value is
	// the maximum time after a subscriber receives a message before the
	// subscriber should acknowledge or Nack the message. If the Ack
	// deadline for a message passes without an Ack or a Nack, the Pub/Sub
	// system will eventually redeliver the message. If a subscriber
	// acknowledges after the deadline, the Pub/Sub system may accept the
	// Ack, but it is possible that the message has been already delivered
	// again. Multiple Acks to the message are allowed and will succeed. For
	// push delivery, this value is used to set the request timeout for the
	// call to the push endpoint. For pull delivery, this value is used as
	// the initial value for the Ack deadline. It may be overridden for each
	// message using its corresponding ack_id with ModifyAckDeadline. While
	// a message is outstanding (i.e. it has been delivered to a pull
	// subscriber and the subscriber has not yet Acked or Nacked), the
	// Pub/Sub system will not deliver that message to another pull
	// subscriber (on a best-effort basis).
	AckDeadlineSeconds int64 `json:"ackDeadlineSeconds,omitempty"`

	// Name: Name of the subscription.
	Name string `json:"name,omitempty"`

	// PushConfig: If push delivery is used with this subscription, this
	// field is used to configure it.
	PushConfig *PushConfig `json:"pushConfig,omitempty"`

	// Topic: The name of the topic from which this subscription is
	// receiving messages.
	Topic string `json:"topic,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "AckDeadlineSeconds")
	// to unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

Subscription: A subscription resource.

func (*Subscription) MarshalJSON

func (s *Subscription) MarshalJSON() ([]byte, error)

type SubscriptionsAcknowledgeCall

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

func (*SubscriptionsAcknowledgeCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SubscriptionsAcknowledgeCall) Do

Do executes the "pubsub.subscriptions.acknowledge" call. Exactly one of *Empty or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SubscriptionsAcknowledgeCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type SubscriptionsCreateCall

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

func (*SubscriptionsCreateCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SubscriptionsCreateCall) Do

Do executes the "pubsub.subscriptions.create" call. Exactly one of *Subscription or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Subscription.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SubscriptionsCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type SubscriptionsDeleteCall

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

func (*SubscriptionsDeleteCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SubscriptionsDeleteCall) Do

func (c *SubscriptionsDeleteCall) Do() (*Empty, error)

Do executes the "pubsub.subscriptions.delete" call. Exactly one of *Empty or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SubscriptionsDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type SubscriptionsGetCall

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

func (*SubscriptionsGetCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SubscriptionsGetCall) Do

Do executes the "pubsub.subscriptions.get" call. Exactly one of *Subscription or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Subscription.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SubscriptionsGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*SubscriptionsGetCall) IfNoneMatch

func (c *SubscriptionsGetCall) IfNoneMatch(entityTag string) *SubscriptionsGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type SubscriptionsListCall

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

func (*SubscriptionsListCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SubscriptionsListCall) Do

Do executes the "pubsub.subscriptions.list" call. Exactly one of *ListSubscriptionsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListSubscriptionsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SubscriptionsListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*SubscriptionsListCall) IfNoneMatch

func (c *SubscriptionsListCall) IfNoneMatch(entityTag string) *SubscriptionsListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*SubscriptionsListCall) MaxResults

func (c *SubscriptionsListCall) MaxResults(maxResults int64) *SubscriptionsListCall

MaxResults sets the optional parameter "maxResults": Maximum number of subscriptions to return.

func (*SubscriptionsListCall) PageToken

func (c *SubscriptionsListCall) PageToken(pageToken string) *SubscriptionsListCall

PageToken sets the optional parameter "pageToken": The value obtained in the last ListSubscriptionsResponse for continuation.

func (*SubscriptionsListCall) Query

Query sets the optional parameter "query": A valid label query expression.

type SubscriptionsModifyAckDeadlineCall

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

func (*SubscriptionsModifyAckDeadlineCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SubscriptionsModifyAckDeadlineCall) Do

Do executes the "pubsub.subscriptions.modifyAckDeadline" call. Exactly one of *Empty or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SubscriptionsModifyAckDeadlineCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type SubscriptionsModifyPushConfigCall

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

func (*SubscriptionsModifyPushConfigCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SubscriptionsModifyPushConfigCall) Do

Do executes the "pubsub.subscriptions.modifyPushConfig" call. Exactly one of *Empty or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SubscriptionsModifyPushConfigCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type SubscriptionsPullBatchCall

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

func (*SubscriptionsPullBatchCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SubscriptionsPullBatchCall) Do

Do executes the "pubsub.subscriptions.pullBatch" call. Exactly one of *PullBatchResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *PullBatchResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SubscriptionsPullBatchCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type SubscriptionsPullCall

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

func (*SubscriptionsPullCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*SubscriptionsPullCall) Do

Do executes the "pubsub.subscriptions.pull" call. Exactly one of *PullResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *PullResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*SubscriptionsPullCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type SubscriptionsService

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

func NewSubscriptionsService

func NewSubscriptionsService(s *Service) *SubscriptionsService

func (*SubscriptionsService) Acknowledge

func (r *SubscriptionsService) Acknowledge(acknowledgerequest *AcknowledgeRequest) *SubscriptionsAcknowledgeCall

Acknowledge: Acknowledges a particular received message: the Pub/Sub system can remove the given message from the subscription. Acknowledging a message whose Ack deadline has expired may succeed, but the message could have been already redelivered. Acknowledging a message more than once will not result in an error. This is only used for messages received via pull.

func (*SubscriptionsService) Create

func (r *SubscriptionsService) Create(subscription *Subscription) *SubscriptionsCreateCall

Create: Creates a subscription on a given topic for a given subscriber. If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.

func (*SubscriptionsService) Delete

func (r *SubscriptionsService) Delete(subscription string) *SubscriptionsDeleteCall

Delete: Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND.

func (*SubscriptionsService) Get

func (r *SubscriptionsService) Get(subscription string) *SubscriptionsGetCall

Get: Gets the configuration details of a subscription.

func (*SubscriptionsService) List

List: Lists matching subscriptions.

func (*SubscriptionsService) ModifyAckDeadline

func (r *SubscriptionsService) ModifyAckDeadline(modifyackdeadlinerequest *ModifyAckDeadlineRequest) *SubscriptionsModifyAckDeadlineCall

ModifyAckDeadline: Modifies the Ack deadline for a message received from a pull request.

func (*SubscriptionsService) ModifyPushConfig

func (r *SubscriptionsService) ModifyPushConfig(modifypushconfigrequest *ModifyPushConfigRequest) *SubscriptionsModifyPushConfigCall

ModifyPushConfig: Modifies the PushConfig for a specified subscription. This method can be used to suspend the flow of messages to an endpoint by clearing the PushConfig field in the request. Messages will be accumulated for delivery even if no push configuration is defined or while the configuration is modified.

func (*SubscriptionsService) Pull

Pull: Pulls a single message from the server. If return_immediately is true, and no messages are available in the subscription, this method returns FAILED_PRECONDITION. The system is free to return an UNAVAILABLE error if no messages are available in a reasonable amount of time (to reduce system load).

func (*SubscriptionsService) PullBatch

func (r *SubscriptionsService) PullBatch(pullbatchrequest *PullBatchRequest) *SubscriptionsPullBatchCall

PullBatch: Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The system is free to return UNAVAILABLE if there are too many pull requests outstanding for the given subscription.

type Topic

type Topic struct {
	// Name: Name of the topic.
	Name string `json:"name,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "Name") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`
}

Topic: A topic resource.

func (*Topic) MarshalJSON

func (s *Topic) MarshalJSON() ([]byte, error)

type TopicsCreateCall

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

func (*TopicsCreateCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TopicsCreateCall) Do

func (c *TopicsCreateCall) Do() (*Topic, error)

Do executes the "pubsub.topics.create" call. Exactly one of *Topic or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Topic.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TopicsCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type TopicsDeleteCall

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

func (*TopicsDeleteCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TopicsDeleteCall) Do

func (c *TopicsDeleteCall) Do() (*Empty, error)

Do executes the "pubsub.topics.delete" call. Exactly one of *Empty or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TopicsDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type TopicsGetCall

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

func (*TopicsGetCall) Context

func (c *TopicsGetCall) Context(ctx context.Context) *TopicsGetCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TopicsGetCall) Do

func (c *TopicsGetCall) Do() (*Topic, error)

Do executes the "pubsub.topics.get" call. Exactly one of *Topic or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Topic.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TopicsGetCall) Fields

func (c *TopicsGetCall) Fields(s ...googleapi.Field) *TopicsGetCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TopicsGetCall) IfNoneMatch

func (c *TopicsGetCall) IfNoneMatch(entityTag string) *TopicsGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type TopicsListCall

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

func (*TopicsListCall) Context

func (c *TopicsListCall) Context(ctx context.Context) *TopicsListCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TopicsListCall) Do

Do executes the "pubsub.topics.list" call. Exactly one of *ListTopicsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListTopicsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TopicsListCall) Fields

func (c *TopicsListCall) Fields(s ...googleapi.Field) *TopicsListCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TopicsListCall) IfNoneMatch

func (c *TopicsListCall) IfNoneMatch(entityTag string) *TopicsListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*TopicsListCall) MaxResults

func (c *TopicsListCall) MaxResults(maxResults int64) *TopicsListCall

MaxResults sets the optional parameter "maxResults": Maximum number of topics to return.

func (*TopicsListCall) PageToken

func (c *TopicsListCall) PageToken(pageToken string) *TopicsListCall

PageToken sets the optional parameter "pageToken": The value obtained in the last ListTopicsResponse for continuation.

func (*TopicsListCall) Query

func (c *TopicsListCall) Query(query string) *TopicsListCall

Query sets the optional parameter "query": A valid label query expression.

type TopicsPublishBatchCall

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

func (*TopicsPublishBatchCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TopicsPublishBatchCall) Do

Do executes the "pubsub.topics.publishBatch" call. Exactly one of *PublishBatchResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *PublishBatchResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TopicsPublishBatchCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type TopicsPublishCall

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

func (*TopicsPublishCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TopicsPublishCall) Do

func (c *TopicsPublishCall) Do() (*Empty, error)

Do executes the "pubsub.topics.publish" call. Exactly one of *Empty or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TopicsPublishCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type TopicsService

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

func NewTopicsService

func NewTopicsService(s *Service) *TopicsService

func (*TopicsService) Create

func (r *TopicsService) Create(topic *Topic) *TopicsCreateCall

Create: Creates the given topic with the given name.

func (*TopicsService) Delete

func (r *TopicsService) Delete(topic string) *TopicsDeleteCall

Delete: Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name.

func (*TopicsService) Get

func (r *TopicsService) Get(topic string) *TopicsGetCall

Get: Gets the configuration of a topic. Since the topic only has the name attribute, this method is only useful to check the existence of a topic. If other attributes are added in the future, they will be returned here.

func (*TopicsService) List

func (r *TopicsService) List() *TopicsListCall

List: Lists matching topics.

func (*TopicsService) Publish

func (r *TopicsService) Publish(publishrequest *PublishRequest) *TopicsPublishCall

Publish: Adds a message to the topic. Returns NOT_FOUND if the topic does not exist.

func (*TopicsService) PublishBatch

func (r *TopicsService) PublishBatch(publishbatchrequest *PublishBatchRequest) *TopicsPublishBatchCall

PublishBatch: Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist.

Jump to

Keyboard shortcuts

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