Documentation ¶
Overview ¶
Package pubsub provides access to the Google Cloud Pub/Sub API.
Usage example:
import "google.golang.org/api/pubsub/v1beta1a" ... pubsubService, err := pubsub.New(oauthHttpClient)
Index ¶
- Constants
- type AcknowledgeRequest
- type Empty
- type Label
- type ListSubscriptionsResponse
- type ListTopicsResponse
- type ModifyAckDeadlineRequest
- type ModifyPushConfigRequest
- type PublishBatchRequest
- type PublishBatchResponse
- type PublishRequest
- type PubsubEvent
- type PubsubMessage
- type PullBatchRequest
- type PullBatchResponse
- type PullRequest
- type PullResponse
- type PushConfig
- type Service
- type Subscription
- type SubscriptionsAcknowledgeCall
- type SubscriptionsCreateCall
- type SubscriptionsDeleteCall
- type SubscriptionsGetCall
- type SubscriptionsListCall
- func (c *SubscriptionsListCall) Do() (*ListSubscriptionsResponse, error)
- func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall
- func (c *SubscriptionsListCall) MaxResults(maxResults int64) *SubscriptionsListCall
- func (c *SubscriptionsListCall) PageToken(pageToken string) *SubscriptionsListCall
- func (c *SubscriptionsListCall) Query(query string) *SubscriptionsListCall
- type SubscriptionsModifyAckDeadlineCall
- type SubscriptionsModifyPushConfigCall
- type SubscriptionsPullBatchCall
- type SubscriptionsPullCall
- type SubscriptionsService
- func (r *SubscriptionsService) Acknowledge(acknowledgerequest *AcknowledgeRequest) *SubscriptionsAcknowledgeCall
- func (r *SubscriptionsService) Create(subscription *Subscription) *SubscriptionsCreateCall
- func (r *SubscriptionsService) Delete(subscription string) *SubscriptionsDeleteCall
- func (r *SubscriptionsService) Get(subscription string) *SubscriptionsGetCall
- func (r *SubscriptionsService) List() *SubscriptionsListCall
- func (r *SubscriptionsService) ModifyAckDeadline(modifyackdeadlinerequest *ModifyAckDeadlineRequest) *SubscriptionsModifyAckDeadlineCall
- func (r *SubscriptionsService) ModifyPushConfig(modifypushconfigrequest *ModifyPushConfigRequest) *SubscriptionsModifyPushConfigCall
- func (r *SubscriptionsService) Pull(pullrequest *PullRequest) *SubscriptionsPullCall
- func (r *SubscriptionsService) PullBatch(pullbatchrequest *PullBatchRequest) *SubscriptionsPullBatchCall
- type Topic
- type TopicsCreateCall
- type TopicsDeleteCall
- type TopicsGetCall
- type TopicsListCall
- func (c *TopicsListCall) Do() (*ListTopicsResponse, error)
- func (c *TopicsListCall) Fields(s ...googleapi.Field) *TopicsListCall
- func (c *TopicsListCall) MaxResults(maxResults int64) *TopicsListCall
- func (c *TopicsListCall) PageToken(pageToken string) *TopicsListCall
- func (c *TopicsListCall) Query(query string) *TopicsListCall
- type TopicsPublishBatchCall
- type TopicsPublishCall
- type TopicsService
- func (r *TopicsService) Create(topic *Topic) *TopicsCreateCall
- func (r *TopicsService) Delete(topic string) *TopicsDeleteCall
- func (r *TopicsService) Get(topic string) *TopicsGetCall
- func (r *TopicsService) List() *TopicsListCall
- func (r *TopicsService) Publish(publishrequest *PublishRequest) *TopicsPublishCall
- func (r *TopicsService) PublishBatch(publishbatchrequest *PublishBatchRequest) *TopicsPublishBatchCall
Constants ¶
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 ListSubscriptionsResponse ¶
type ListSubscriptionsResponse struct { NextPageToken string `json:"nextPageToken,omitempty"` Subscription []*Subscription `json:"subscription,omitempty"` }
type ListTopicsResponse ¶
type ModifyPushConfigRequest ¶
type ModifyPushConfigRequest struct { PushConfig *PushConfig `json:"pushConfig,omitempty"` Subscription string `json:"subscription,omitempty"` }
type PublishBatchRequest ¶
type PublishBatchRequest struct { Messages []*PubsubMessage `json:"messages,omitempty"` Topic string `json:"topic,omitempty"` }
type PublishBatchResponse ¶
type PublishBatchResponse struct {
MessageIds []string `json:"messageIds,omitempty"`
}
type PublishRequest ¶
type PublishRequest struct { Message *PubsubMessage `json:"message,omitempty"` Topic string `json:"topic,omitempty"` }
type PubsubEvent ¶
type PubsubEvent struct { Deleted bool `json:"deleted,omitempty"` Message *PubsubMessage `json:"message,omitempty"` Subscription string `json:"subscription,omitempty"` Truncated bool `json:"truncated,omitempty"` }
type PubsubMessage ¶
type PullBatchRequest ¶
type PullBatchResponse ¶
type PullBatchResponse struct {
PullResponses []*PullResponse `json:"pullResponses,omitempty"`
}
type PullRequest ¶
type PullResponse ¶
type PullResponse struct { AckId string `json:"ackId,omitempty"` PubsubEvent *PubsubEvent `json:"pubsubEvent,omitempty"` }
type PushConfig ¶
type PushConfig struct {
PushEndpoint string `json:"pushEndpoint,omitempty"`
}
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 }
type Subscription ¶
type Subscription struct { AckDeadlineSeconds int64 `json:"ackDeadlineSeconds,omitempty"` Name string `json:"name,omitempty"` PushConfig *PushConfig `json:"pushConfig,omitempty"` Topic string `json:"topic,omitempty"` }
type SubscriptionsAcknowledgeCall ¶
type SubscriptionsAcknowledgeCall struct {
// contains filtered or unexported fields
}
func (*SubscriptionsAcknowledgeCall) Do ¶
func (c *SubscriptionsAcknowledgeCall) Do() (*Empty, error)
func (*SubscriptionsAcknowledgeCall) Fields ¶
func (c *SubscriptionsAcknowledgeCall) Fields(s ...googleapi.Field) *SubscriptionsAcknowledgeCall
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) Do ¶
func (c *SubscriptionsCreateCall) Do() (*Subscription, error)
func (*SubscriptionsCreateCall) Fields ¶
func (c *SubscriptionsCreateCall) Fields(s ...googleapi.Field) *SubscriptionsCreateCall
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) Do ¶
func (c *SubscriptionsDeleteCall) Do() (*Empty, error)
func (*SubscriptionsDeleteCall) Fields ¶
func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall
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) Do ¶
func (c *SubscriptionsGetCall) Do() (*Subscription, error)
func (*SubscriptionsGetCall) Fields ¶
func (c *SubscriptionsGetCall) Fields(s ...googleapi.Field) *SubscriptionsGetCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
type SubscriptionsListCall ¶
type SubscriptionsListCall struct {
// contains filtered or unexported fields
}
func (*SubscriptionsListCall) Do ¶
func (c *SubscriptionsListCall) Do() (*ListSubscriptionsResponse, error)
func (*SubscriptionsListCall) Fields ¶
func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*SubscriptionsListCall) MaxResults ¶
func (c *SubscriptionsListCall) MaxResults(maxResults int64) *SubscriptionsListCall
MaxResults sets the optional parameter "maxResults":
func (*SubscriptionsListCall) PageToken ¶
func (c *SubscriptionsListCall) PageToken(pageToken string) *SubscriptionsListCall
PageToken sets the optional parameter "pageToken":
func (*SubscriptionsListCall) Query ¶
func (c *SubscriptionsListCall) Query(query string) *SubscriptionsListCall
Query sets the optional parameter "query":
type SubscriptionsModifyAckDeadlineCall ¶
type SubscriptionsModifyAckDeadlineCall struct {
// contains filtered or unexported fields
}
func (*SubscriptionsModifyAckDeadlineCall) Do ¶
func (c *SubscriptionsModifyAckDeadlineCall) Do() (*Empty, error)
func (*SubscriptionsModifyAckDeadlineCall) Fields ¶
func (c *SubscriptionsModifyAckDeadlineCall) Fields(s ...googleapi.Field) *SubscriptionsModifyAckDeadlineCall
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) Do ¶
func (c *SubscriptionsModifyPushConfigCall) Do() (*Empty, error)
func (*SubscriptionsModifyPushConfigCall) Fields ¶
func (c *SubscriptionsModifyPushConfigCall) Fields(s ...googleapi.Field) *SubscriptionsModifyPushConfigCall
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) Do ¶
func (c *SubscriptionsPullBatchCall) Do() (*PullBatchResponse, error)
func (*SubscriptionsPullBatchCall) Fields ¶
func (c *SubscriptionsPullBatchCall) Fields(s ...googleapi.Field) *SubscriptionsPullBatchCall
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) Do ¶
func (c *SubscriptionsPullCall) Do() (*PullResponse, error)
func (*SubscriptionsPullCall) Fields ¶
func (c *SubscriptionsPullCall) Fields(s ...googleapi.Field) *SubscriptionsPullCall
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 ¶
func (r *SubscriptionsService) List() *SubscriptionsListCall
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 ¶
func (r *SubscriptionsService) Pull(pullrequest *PullRequest) *SubscriptionsPullCall
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 TopicsCreateCall ¶
type TopicsCreateCall struct {
// contains filtered or unexported fields
}
func (*TopicsCreateCall) Do ¶
func (c *TopicsCreateCall) Do() (*Topic, error)
func (*TopicsCreateCall) Fields ¶
func (c *TopicsCreateCall) Fields(s ...googleapi.Field) *TopicsCreateCall
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) Do ¶
func (c *TopicsDeleteCall) Do() (*Empty, error)
func (*TopicsDeleteCall) Fields ¶
func (c *TopicsDeleteCall) Fields(s ...googleapi.Field) *TopicsDeleteCall
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) Do ¶
func (c *TopicsGetCall) Do() (*Topic, error)
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.
type TopicsListCall ¶
type TopicsListCall struct {
// contains filtered or unexported fields
}
func (*TopicsListCall) Do ¶
func (c *TopicsListCall) Do() (*ListTopicsResponse, error)
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) MaxResults ¶
func (c *TopicsListCall) MaxResults(maxResults int64) *TopicsListCall
MaxResults sets the optional parameter "maxResults":
func (*TopicsListCall) PageToken ¶
func (c *TopicsListCall) PageToken(pageToken string) *TopicsListCall
PageToken sets the optional parameter "pageToken":
func (*TopicsListCall) Query ¶
func (c *TopicsListCall) Query(query string) *TopicsListCall
Query sets the optional parameter "query":
type TopicsPublishBatchCall ¶
type TopicsPublishBatchCall struct {
// contains filtered or unexported fields
}
func (*TopicsPublishBatchCall) Do ¶
func (c *TopicsPublishBatchCall) Do() (*PublishBatchResponse, error)
func (*TopicsPublishBatchCall) Fields ¶
func (c *TopicsPublishBatchCall) Fields(s ...googleapi.Field) *TopicsPublishBatchCall
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) Do ¶
func (c *TopicsPublishCall) Do() (*Empty, error)
func (*TopicsPublishCall) Fields ¶
func (c *TopicsPublishCall) Fields(s ...googleapi.Field) *TopicsPublishCall
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.