Documentation ¶
Overview ¶
Package pubsub provides access to the Google Cloud Pub/Sub API.
Usage example:
import "google.golang.org/api/pubsub/v1beta2" ... pubsubService, err := pubsub.New(oauthHttpClient)
Index ¶
- Constants
- type AcknowledgeRequest
- type Empty
- type ListSubscriptionsResponse
- type ListTopicSubscriptionsResponse
- type ListTopicsResponse
- type ModifyAckDeadlineRequest
- type ModifyPushConfigRequest
- type ProjectsService
- type ProjectsSubscriptionsAcknowledgeCall
- type ProjectsSubscriptionsCreateCall
- type ProjectsSubscriptionsDeleteCall
- type ProjectsSubscriptionsGetCall
- type ProjectsSubscriptionsListCall
- func (c *ProjectsSubscriptionsListCall) Do() (*ListSubscriptionsResponse, error)
- func (c *ProjectsSubscriptionsListCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsListCall
- func (c *ProjectsSubscriptionsListCall) PageSize(pageSize int64) *ProjectsSubscriptionsListCall
- func (c *ProjectsSubscriptionsListCall) PageToken(pageToken string) *ProjectsSubscriptionsListCall
- type ProjectsSubscriptionsModifyAckDeadlineCall
- type ProjectsSubscriptionsModifyPushConfigCall
- type ProjectsSubscriptionsPullCall
- type ProjectsSubscriptionsService
- func (r *ProjectsSubscriptionsService) Acknowledge(subscription string, acknowledgerequest *AcknowledgeRequest) *ProjectsSubscriptionsAcknowledgeCall
- func (r *ProjectsSubscriptionsService) Create(name string, subscription *Subscription) *ProjectsSubscriptionsCreateCall
- func (r *ProjectsSubscriptionsService) Delete(subscription string) *ProjectsSubscriptionsDeleteCall
- func (r *ProjectsSubscriptionsService) Get(subscription string) *ProjectsSubscriptionsGetCall
- func (r *ProjectsSubscriptionsService) List(project string) *ProjectsSubscriptionsListCall
- func (r *ProjectsSubscriptionsService) ModifyAckDeadline(subscription string, modifyackdeadlinerequest *ModifyAckDeadlineRequest) *ProjectsSubscriptionsModifyAckDeadlineCall
- func (r *ProjectsSubscriptionsService) ModifyPushConfig(subscription string, modifypushconfigrequest *ModifyPushConfigRequest) *ProjectsSubscriptionsModifyPushConfigCall
- func (r *ProjectsSubscriptionsService) Pull(subscription string, pullrequest *PullRequest) *ProjectsSubscriptionsPullCall
- type ProjectsTopicsCreateCall
- type ProjectsTopicsDeleteCall
- type ProjectsTopicsGetCall
- type ProjectsTopicsListCall
- func (c *ProjectsTopicsListCall) Do() (*ListTopicsResponse, error)
- func (c *ProjectsTopicsListCall) Fields(s ...googleapi.Field) *ProjectsTopicsListCall
- func (c *ProjectsTopicsListCall) PageSize(pageSize int64) *ProjectsTopicsListCall
- func (c *ProjectsTopicsListCall) PageToken(pageToken string) *ProjectsTopicsListCall
- type ProjectsTopicsPublishCall
- type ProjectsTopicsService
- func (r *ProjectsTopicsService) Create(name string, topic *Topic) *ProjectsTopicsCreateCall
- func (r *ProjectsTopicsService) Delete(topic string) *ProjectsTopicsDeleteCall
- func (r *ProjectsTopicsService) Get(topic string) *ProjectsTopicsGetCall
- func (r *ProjectsTopicsService) List(project string) *ProjectsTopicsListCall
- func (r *ProjectsTopicsService) Publish(topic string, publishrequest *PublishRequest) *ProjectsTopicsPublishCall
- type ProjectsTopicsSubscriptionsListCall
- func (c *ProjectsTopicsSubscriptionsListCall) Do() (*ListTopicSubscriptionsResponse, error)
- func (c *ProjectsTopicsSubscriptionsListCall) Fields(s ...googleapi.Field) *ProjectsTopicsSubscriptionsListCall
- func (c *ProjectsTopicsSubscriptionsListCall) PageSize(pageSize int64) *ProjectsTopicsSubscriptionsListCall
- func (c *ProjectsTopicsSubscriptionsListCall) PageToken(pageToken string) *ProjectsTopicsSubscriptionsListCall
- type ProjectsTopicsSubscriptionsService
- type PublishRequest
- type PublishResponse
- type PubsubMessage
- type PullRequest
- type PullResponse
- type PushConfig
- type ReceivedMessage
- type Service
- type Subscription
- type Topic
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 AcknowledgeRequest struct {
AckIds []string `json:"ackIds,omitempty"`
}
type ListSubscriptionsResponse ¶
type ListSubscriptionsResponse struct { NextPageToken string `json:"nextPageToken,omitempty"` Subscriptions []*Subscription `json:"subscriptions,omitempty"` }
type ListTopicsResponse ¶
type ModifyPushConfigRequest ¶
type ModifyPushConfigRequest struct {
PushConfig *PushConfig `json:"pushConfig,omitempty"`
}
type ProjectsService ¶
type ProjectsService struct { Subscriptions *ProjectsSubscriptionsService Topics *ProjectsTopicsService // contains filtered or unexported fields }
func NewProjectsService ¶
func NewProjectsService(s *Service) *ProjectsService
type ProjectsSubscriptionsAcknowledgeCall ¶
type ProjectsSubscriptionsAcknowledgeCall struct {
// contains filtered or unexported fields
}
func (*ProjectsSubscriptionsAcknowledgeCall) Do ¶
func (c *ProjectsSubscriptionsAcknowledgeCall) Do() (*Empty, error)
func (*ProjectsSubscriptionsAcknowledgeCall) Fields ¶
func (c *ProjectsSubscriptionsAcknowledgeCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsAcknowledgeCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
type ProjectsSubscriptionsCreateCall ¶
type ProjectsSubscriptionsCreateCall struct {
// contains filtered or unexported fields
}
func (*ProjectsSubscriptionsCreateCall) Do ¶
func (c *ProjectsSubscriptionsCreateCall) Do() (*Subscription, error)
func (*ProjectsSubscriptionsCreateCall) Fields ¶
func (c *ProjectsSubscriptionsCreateCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsCreateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
type ProjectsSubscriptionsDeleteCall ¶
type ProjectsSubscriptionsDeleteCall struct {
// contains filtered or unexported fields
}
func (*ProjectsSubscriptionsDeleteCall) Do ¶
func (c *ProjectsSubscriptionsDeleteCall) Do() (*Empty, error)
func (*ProjectsSubscriptionsDeleteCall) Fields ¶
func (c *ProjectsSubscriptionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
type ProjectsSubscriptionsGetCall ¶
type ProjectsSubscriptionsGetCall struct {
// contains filtered or unexported fields
}
func (*ProjectsSubscriptionsGetCall) Do ¶
func (c *ProjectsSubscriptionsGetCall) Do() (*Subscription, error)
func (*ProjectsSubscriptionsGetCall) Fields ¶
func (c *ProjectsSubscriptionsGetCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsGetCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
type ProjectsSubscriptionsListCall ¶
type ProjectsSubscriptionsListCall struct {
// contains filtered or unexported fields
}
func (*ProjectsSubscriptionsListCall) Do ¶
func (c *ProjectsSubscriptionsListCall) Do() (*ListSubscriptionsResponse, error)
func (*ProjectsSubscriptionsListCall) Fields ¶
func (c *ProjectsSubscriptionsListCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*ProjectsSubscriptionsListCall) PageSize ¶
func (c *ProjectsSubscriptionsListCall) PageSize(pageSize int64) *ProjectsSubscriptionsListCall
PageSize sets the optional parameter "pageSize":
func (*ProjectsSubscriptionsListCall) PageToken ¶
func (c *ProjectsSubscriptionsListCall) PageToken(pageToken string) *ProjectsSubscriptionsListCall
PageToken sets the optional parameter "pageToken":
type ProjectsSubscriptionsModifyAckDeadlineCall ¶
type ProjectsSubscriptionsModifyAckDeadlineCall struct {
// contains filtered or unexported fields
}
func (*ProjectsSubscriptionsModifyAckDeadlineCall) Do ¶
func (c *ProjectsSubscriptionsModifyAckDeadlineCall) Do() (*Empty, error)
func (*ProjectsSubscriptionsModifyAckDeadlineCall) Fields ¶
func (c *ProjectsSubscriptionsModifyAckDeadlineCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsModifyAckDeadlineCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
type ProjectsSubscriptionsModifyPushConfigCall ¶
type ProjectsSubscriptionsModifyPushConfigCall struct {
// contains filtered or unexported fields
}
func (*ProjectsSubscriptionsModifyPushConfigCall) Do ¶
func (c *ProjectsSubscriptionsModifyPushConfigCall) Do() (*Empty, error)
func (*ProjectsSubscriptionsModifyPushConfigCall) Fields ¶
func (c *ProjectsSubscriptionsModifyPushConfigCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsModifyPushConfigCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
type ProjectsSubscriptionsPullCall ¶
type ProjectsSubscriptionsPullCall struct {
// contains filtered or unexported fields
}
func (*ProjectsSubscriptionsPullCall) Do ¶
func (c *ProjectsSubscriptionsPullCall) Do() (*PullResponse, error)
func (*ProjectsSubscriptionsPullCall) Fields ¶
func (c *ProjectsSubscriptionsPullCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsPullCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
type ProjectsSubscriptionsService ¶
type ProjectsSubscriptionsService struct {
// contains filtered or unexported fields
}
func NewProjectsSubscriptionsService ¶
func NewProjectsSubscriptionsService(s *Service) *ProjectsSubscriptionsService
func (*ProjectsSubscriptionsService) Acknowledge ¶
func (r *ProjectsSubscriptionsService) Acknowledge(subscription string, acknowledgerequest *AcknowledgeRequest) *ProjectsSubscriptionsAcknowledgeCall
Acknowledge: Acknowledges the messages associated with the ack tokens in the AcknowledgeRequest. The Pub/Sub system can remove the relevant messages from the subscription. Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error.
func (*ProjectsSubscriptionsService) Create ¶
func (r *ProjectsSubscriptionsService) Create(name string, subscription *Subscription) *ProjectsSubscriptionsCreateCall
Create: Creates a subscription to 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 (*ProjectsSubscriptionsService) Delete ¶
func (r *ProjectsSubscriptionsService) Delete(subscription string) *ProjectsSubscriptionsDeleteCall
Delete: Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription, or its topic unless the same topic is specified.
func (*ProjectsSubscriptionsService) Get ¶
func (r *ProjectsSubscriptionsService) Get(subscription string) *ProjectsSubscriptionsGetCall
Get: Gets the configuration details of a subscription.
func (*ProjectsSubscriptionsService) List ¶
func (r *ProjectsSubscriptionsService) List(project string) *ProjectsSubscriptionsListCall
List: Lists matching subscriptions.
func (*ProjectsSubscriptionsService) ModifyAckDeadline ¶
func (r *ProjectsSubscriptionsService) ModifyAckDeadline(subscription string, modifyackdeadlinerequest *ModifyAckDeadlineRequest) *ProjectsSubscriptionsModifyAckDeadlineCall
ModifyAckDeadline: Modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted.
func (*ProjectsSubscriptionsService) ModifyPushConfig ¶
func (r *ProjectsSubscriptionsService) ModifyPushConfig(subscription string, modifypushconfigrequest *ModifyPushConfigRequest) *ProjectsSubscriptionsModifyPushConfigCall
ModifyPushConfig: Modifies the PushConfig for a specified subscription. This may be used to change a push subscription to a pull one (signified by an empty PushConfig) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the PushConfig.
func (*ProjectsSubscriptionsService) Pull ¶
func (r *ProjectsSubscriptionsService) Pull(subscription string, pullrequest *PullRequest) *ProjectsSubscriptionsPullCall
Pull: Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The server may return UNAVAILABLE if there are too many concurrent pull requests pending for the given subscription.
type ProjectsTopicsCreateCall ¶
type ProjectsTopicsCreateCall struct {
// contains filtered or unexported fields
}
func (*ProjectsTopicsCreateCall) Do ¶
func (c *ProjectsTopicsCreateCall) Do() (*Topic, error)
func (*ProjectsTopicsCreateCall) Fields ¶
func (c *ProjectsTopicsCreateCall) Fields(s ...googleapi.Field) *ProjectsTopicsCreateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
type ProjectsTopicsDeleteCall ¶
type ProjectsTopicsDeleteCall struct {
// contains filtered or unexported fields
}
func (*ProjectsTopicsDeleteCall) Do ¶
func (c *ProjectsTopicsDeleteCall) Do() (*Empty, error)
func (*ProjectsTopicsDeleteCall) Fields ¶
func (c *ProjectsTopicsDeleteCall) Fields(s ...googleapi.Field) *ProjectsTopicsDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
type ProjectsTopicsGetCall ¶
type ProjectsTopicsGetCall struct {
// contains filtered or unexported fields
}
func (*ProjectsTopicsGetCall) Do ¶
func (c *ProjectsTopicsGetCall) Do() (*Topic, error)
func (*ProjectsTopicsGetCall) Fields ¶
func (c *ProjectsTopicsGetCall) Fields(s ...googleapi.Field) *ProjectsTopicsGetCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
type ProjectsTopicsListCall ¶
type ProjectsTopicsListCall struct {
// contains filtered or unexported fields
}
func (*ProjectsTopicsListCall) Do ¶
func (c *ProjectsTopicsListCall) Do() (*ListTopicsResponse, error)
func (*ProjectsTopicsListCall) Fields ¶
func (c *ProjectsTopicsListCall) Fields(s ...googleapi.Field) *ProjectsTopicsListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*ProjectsTopicsListCall) PageSize ¶
func (c *ProjectsTopicsListCall) PageSize(pageSize int64) *ProjectsTopicsListCall
PageSize sets the optional parameter "pageSize":
func (*ProjectsTopicsListCall) PageToken ¶
func (c *ProjectsTopicsListCall) PageToken(pageToken string) *ProjectsTopicsListCall
PageToken sets the optional parameter "pageToken":
type ProjectsTopicsPublishCall ¶
type ProjectsTopicsPublishCall struct {
// contains filtered or unexported fields
}
func (*ProjectsTopicsPublishCall) Do ¶
func (c *ProjectsTopicsPublishCall) Do() (*PublishResponse, error)
func (*ProjectsTopicsPublishCall) Fields ¶
func (c *ProjectsTopicsPublishCall) Fields(s ...googleapi.Field) *ProjectsTopicsPublishCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
type ProjectsTopicsService ¶
type ProjectsTopicsService struct { Subscriptions *ProjectsTopicsSubscriptionsService // contains filtered or unexported fields }
func NewProjectsTopicsService ¶
func NewProjectsTopicsService(s *Service) *ProjectsTopicsService
func (*ProjectsTopicsService) Create ¶
func (r *ProjectsTopicsService) Create(name string, topic *Topic) *ProjectsTopicsCreateCall
Create: Creates the given topic with the given name.
func (*ProjectsTopicsService) Delete ¶
func (r *ProjectsTopicsService) Delete(topic string) *ProjectsTopicsDeleteCall
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; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted.
func (*ProjectsTopicsService) Get ¶
func (r *ProjectsTopicsService) Get(topic string) *ProjectsTopicsGetCall
Get: Gets the configuration of a topic.
func (*ProjectsTopicsService) List ¶
func (r *ProjectsTopicsService) List(project string) *ProjectsTopicsListCall
List: Lists matching topics.
func (*ProjectsTopicsService) Publish ¶
func (r *ProjectsTopicsService) Publish(topic string, publishrequest *PublishRequest) *ProjectsTopicsPublishCall
Publish: Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist.
type ProjectsTopicsSubscriptionsListCall ¶
type ProjectsTopicsSubscriptionsListCall struct {
// contains filtered or unexported fields
}
func (*ProjectsTopicsSubscriptionsListCall) Do ¶
func (c *ProjectsTopicsSubscriptionsListCall) Do() (*ListTopicSubscriptionsResponse, error)
func (*ProjectsTopicsSubscriptionsListCall) Fields ¶
func (c *ProjectsTopicsSubscriptionsListCall) Fields(s ...googleapi.Field) *ProjectsTopicsSubscriptionsListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*ProjectsTopicsSubscriptionsListCall) PageSize ¶
func (c *ProjectsTopicsSubscriptionsListCall) PageSize(pageSize int64) *ProjectsTopicsSubscriptionsListCall
PageSize sets the optional parameter "pageSize":
func (*ProjectsTopicsSubscriptionsListCall) PageToken ¶
func (c *ProjectsTopicsSubscriptionsListCall) PageToken(pageToken string) *ProjectsTopicsSubscriptionsListCall
PageToken sets the optional parameter "pageToken":
type ProjectsTopicsSubscriptionsService ¶
type ProjectsTopicsSubscriptionsService struct {
// contains filtered or unexported fields
}
func NewProjectsTopicsSubscriptionsService ¶
func NewProjectsTopicsSubscriptionsService(s *Service) *ProjectsTopicsSubscriptionsService
func (*ProjectsTopicsSubscriptionsService) List ¶
func (r *ProjectsTopicsSubscriptionsService) List(topic string) *ProjectsTopicsSubscriptionsListCall
List: Lists the name of the subscriptions for this topic.
type PublishRequest ¶
type PublishRequest struct {
Messages []*PubsubMessage `json:"messages,omitempty"`
}
type PublishResponse ¶
type PublishResponse struct {
MessageIds []string `json:"messageIds,omitempty"`
}
type PubsubMessage ¶
type PullRequest ¶
type PullResponse ¶
type PullResponse struct {
ReceivedMessages []*ReceivedMessage `json:"receivedMessages,omitempty"`
}
type PushConfig ¶
type ReceivedMessage ¶
type ReceivedMessage struct { AckId string `json:"ackId,omitempty"` Message *PubsubMessage `json:"message,omitempty"` }
type Service ¶
type Service struct { BasePath string // API endpoint base URL UserAgent string // optional additional User-Agent fragment Projects *ProjectsService // 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"` }