Documentation
¶
Overview ¶
Package pubsub provides access to the Google Cloud Pub/Sub API.
See https://developers.google.com/pubsub/v1beta1
Usage example:
import "github.com/jfcote87/api2/pubsub/v1beta1" ... pubsubService, err := pubsub.New(oauthHttpClient)
Index ¶
- Constants
- type AcknowledgeRequest
- 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) Context(ctx context.Context) *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) Context(ctx context.Context) *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 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"` }
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"` }
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"` }
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"` }
type ModifyAckDeadlineRequest ¶
type ModifyAckDeadlineRequest struct { // AckDeadlineSeconds: The new Ack deadline. Must be >= 0. AckDeadlineSeconds int64 `json:"ackDeadlineSeconds,omitempty"` // AckId: The acknowledgment ID. AckId string `json:"ackId,omitempty"` // Subscription: The name of the subscription from which messages are // being pulled. Subscription string `json:"subscription,omitempty"` }
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"` }
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"` }
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"` }
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"` }
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"` }
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"` }
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"` }
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"` }
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"` }
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"` }
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"` }
type Service ¶
type Service struct { Subscriptions *SubscriptionsService Topics *TopicsService // contains filtered or unexported fields }
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 a specific pull request (message) 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"` }
type SubscriptionsAcknowledgeCall ¶
type SubscriptionsAcknowledgeCall struct {
// contains filtered or unexported fields
}
func (*SubscriptionsAcknowledgeCall) Context ¶
func (c *SubscriptionsAcknowledgeCall) Context(ctx context.Context) *SubscriptionsAcknowledgeCall
func (*SubscriptionsAcknowledgeCall) Do ¶
func (c *SubscriptionsAcknowledgeCall) Do() error
type SubscriptionsCreateCall ¶
type SubscriptionsCreateCall struct {
// contains filtered or unexported fields
}
func (*SubscriptionsCreateCall) Context ¶
func (c *SubscriptionsCreateCall) Context(ctx context.Context) *SubscriptionsCreateCall
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) Context ¶
func (c *SubscriptionsDeleteCall) Context(ctx context.Context) *SubscriptionsDeleteCall
func (*SubscriptionsDeleteCall) Do ¶
func (c *SubscriptionsDeleteCall) Do() error
type SubscriptionsGetCall ¶
type SubscriptionsGetCall struct {
// contains filtered or unexported fields
}
func (*SubscriptionsGetCall) Context ¶
func (c *SubscriptionsGetCall) Context(ctx context.Context) *SubscriptionsGetCall
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) Context ¶
func (c *SubscriptionsListCall) Context(ctx context.Context) *SubscriptionsListCall
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": 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 ¶
func (c *SubscriptionsListCall) Query(query string) *SubscriptionsListCall
Query sets the optional parameter "query": A valid label query expression.
type SubscriptionsModifyAckDeadlineCall ¶
type SubscriptionsModifyAckDeadlineCall struct {
// contains filtered or unexported fields
}
func (*SubscriptionsModifyAckDeadlineCall) Context ¶
func (c *SubscriptionsModifyAckDeadlineCall) Context(ctx context.Context) *SubscriptionsModifyAckDeadlineCall
func (*SubscriptionsModifyAckDeadlineCall) Do ¶
func (c *SubscriptionsModifyAckDeadlineCall) Do() error
type SubscriptionsModifyPushConfigCall ¶
type SubscriptionsModifyPushConfigCall struct {
// contains filtered or unexported fields
}
func (*SubscriptionsModifyPushConfigCall) Context ¶
func (c *SubscriptionsModifyPushConfigCall) Context(ctx context.Context) *SubscriptionsModifyPushConfigCall
func (*SubscriptionsModifyPushConfigCall) Do ¶
func (c *SubscriptionsModifyPushConfigCall) Do() error
type SubscriptionsPullBatchCall ¶
type SubscriptionsPullBatchCall struct {
// contains filtered or unexported fields
}
func (*SubscriptionsPullBatchCall) Context ¶
func (c *SubscriptionsPullBatchCall) Context(ctx context.Context) *SubscriptionsPullBatchCall
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) Context ¶
func (c *SubscriptionsPullCall) Context(ctx context.Context) *SubscriptionsPullCall
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
func (*SubscriptionsService) Create ¶
func (r *SubscriptionsService) Create(subscription *Subscription) *SubscriptionsCreateCall
func (*SubscriptionsService) Delete ¶
func (r *SubscriptionsService) Delete(subscription string) *SubscriptionsDeleteCall
func (*SubscriptionsService) Get ¶
func (r *SubscriptionsService) Get(subscription string) *SubscriptionsGetCall
func (*SubscriptionsService) List ¶
func (r *SubscriptionsService) List() *SubscriptionsListCall
func (*SubscriptionsService) ModifyAckDeadline ¶
func (r *SubscriptionsService) ModifyAckDeadline(modifyackdeadlinerequest *ModifyAckDeadlineRequest) *SubscriptionsModifyAckDeadlineCall
func (*SubscriptionsService) ModifyPushConfig ¶
func (r *SubscriptionsService) ModifyPushConfig(modifypushconfigrequest *ModifyPushConfigRequest) *SubscriptionsModifyPushConfigCall
func (*SubscriptionsService) Pull ¶
func (r *SubscriptionsService) Pull(pullrequest *PullRequest) *SubscriptionsPullCall
func (*SubscriptionsService) PullBatch ¶
func (r *SubscriptionsService) PullBatch(pullbatchrequest *PullBatchRequest) *SubscriptionsPullBatchCall
type TopicsCreateCall ¶
type TopicsCreateCall struct {
// contains filtered or unexported fields
}
func (*TopicsCreateCall) Context ¶
func (c *TopicsCreateCall) Context(ctx context.Context) *TopicsCreateCall
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) Context ¶
func (c *TopicsDeleteCall) Context(ctx context.Context) *TopicsDeleteCall
func (*TopicsDeleteCall) Do ¶
func (c *TopicsDeleteCall) Do() error
type TopicsGetCall ¶
type TopicsGetCall struct {
// contains filtered or unexported fields
}
func (*TopicsGetCall) Context ¶
func (c *TopicsGetCall) Context(ctx context.Context) *TopicsGetCall
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) Context ¶
func (c *TopicsListCall) Context(ctx context.Context) *TopicsListCall
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": 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 ¶
func (c *TopicsPublishBatchCall) Context(ctx context.Context) *TopicsPublishBatchCall
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) Context ¶
func (c *TopicsPublishCall) Context(ctx context.Context) *TopicsPublishCall
func (*TopicsPublishCall) Do ¶
func (c *TopicsPublishCall) Do() error
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
func (*TopicsService) Delete ¶
func (r *TopicsService) Delete(topic string) *TopicsDeleteCall
func (*TopicsService) Get ¶
func (r *TopicsService) Get(topic string) *TopicsGetCall
func (*TopicsService) List ¶
func (r *TopicsService) List() *TopicsListCall
func (*TopicsService) Publish ¶
func (r *TopicsService) Publish(publishrequest *PublishRequest) *TopicsPublishCall
func (*TopicsService) PublishBatch ¶
func (r *TopicsService) PublishBatch(publishbatchrequest *PublishBatchRequest) *TopicsPublishBatchCall