pubsub
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package pubsub provides access to the Cloud Pub/Sub API.
This package is DEPRECATED. Use package cloud.google.com/go/pubsub instead.
For product documentation, see:https://cloud.google.com/pubsub/docs
Library status¶
These client libraries are officially supported by Google. However, thislibrary is considered complete and is in maintenance mode. This meansthat we will address critical bugs and security issues but will not addany new features.
When possible, we recommend using our newer[Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)that are still actively being worked and iterated on.
Creating a client¶
Usage example:
import "google.golang.org/api/pubsub/v1beta1a"...ctx := context.Background()pubsubService, err := pubsub.NewService(ctx)
In this example, Google Application Default Credentials are used forauthentication. For information on how to create and obtain ApplicationDefault Credentials, seehttps://developers.google.com/identity/protocols/application-default-credentials.
Other authentication options¶
By default, all available scopes (see "Constants") are used to authenticate.To restrict scopes, usegoogle.golang.org/api/option.WithScopes:
pubsubService, err := pubsub.NewService(ctx, option.WithScopes(pubsub.PubsubScope))
To use an API key for authentication (note: some APIs do not support APIkeys), usegoogle.golang.org/api/option.WithAPIKey:
pubsubService, err := pubsub.NewService(ctx, option.WithAPIKey("AIza..."))To use an OAuth token (e.g., a user token obtained via a three-legged OAuthflow, usegoogle.golang.org/api/option.WithTokenSource:
config := &oauth2.Config{...}// ...token, err := config.Exchange(ctx, ...)pubsubService, err := pubsub.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))Seegoogle.golang.org/api/option.ClientOption for details on options.
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
- func (c *SubscriptionsAcknowledgeCall) Context(ctx context.Context) *SubscriptionsAcknowledgeCall
- func (c *SubscriptionsAcknowledgeCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *SubscriptionsAcknowledgeCall) Fields(s ...googleapi.Field) *SubscriptionsAcknowledgeCall
- func (c *SubscriptionsAcknowledgeCall) Header() http.Header
- type SubscriptionsCreateCall
- func (c *SubscriptionsCreateCall) Context(ctx context.Context) *SubscriptionsCreateCall
- func (c *SubscriptionsCreateCall) Do(opts ...googleapi.CallOption) (*Subscription, error)
- func (c *SubscriptionsCreateCall) Fields(s ...googleapi.Field) *SubscriptionsCreateCall
- func (c *SubscriptionsCreateCall) Header() http.Header
- type SubscriptionsDeleteCall
- func (c *SubscriptionsDeleteCall) Context(ctx context.Context) *SubscriptionsDeleteCall
- func (c *SubscriptionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall
- func (c *SubscriptionsDeleteCall) Header() http.Header
- type SubscriptionsGetCall
- func (c *SubscriptionsGetCall) Context(ctx context.Context) *SubscriptionsGetCall
- func (c *SubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*Subscription, error)
- func (c *SubscriptionsGetCall) Fields(s ...googleapi.Field) *SubscriptionsGetCall
- func (c *SubscriptionsGetCall) Header() http.Header
- func (c *SubscriptionsGetCall) IfNoneMatch(entityTag string) *SubscriptionsGetCall
- type SubscriptionsListCall
- func (c *SubscriptionsListCall) Context(ctx context.Context) *SubscriptionsListCall
- func (c *SubscriptionsListCall) Do(opts ...googleapi.CallOption) (*ListSubscriptionsResponse, error)
- func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall
- func (c *SubscriptionsListCall) Header() http.Header
- func (c *SubscriptionsListCall) IfNoneMatch(entityTag string) *SubscriptionsListCall
- func (c *SubscriptionsListCall) MaxResults(maxResults int64) *SubscriptionsListCall
- func (c *SubscriptionsListCall) PageToken(pageToken string) *SubscriptionsListCall
- func (c *SubscriptionsListCall) Pages(ctx context.Context, f func(*ListSubscriptionsResponse) error) error
- func (c *SubscriptionsListCall) Query(query string) *SubscriptionsListCall
- type SubscriptionsModifyAckDeadlineCall
- func (c *SubscriptionsModifyAckDeadlineCall) Context(ctx context.Context) *SubscriptionsModifyAckDeadlineCall
- func (c *SubscriptionsModifyAckDeadlineCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *SubscriptionsModifyAckDeadlineCall) Fields(s ...googleapi.Field) *SubscriptionsModifyAckDeadlineCall
- func (c *SubscriptionsModifyAckDeadlineCall) Header() http.Header
- type SubscriptionsModifyPushConfigCall
- func (c *SubscriptionsModifyPushConfigCall) Context(ctx context.Context) *SubscriptionsModifyPushConfigCall
- func (c *SubscriptionsModifyPushConfigCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *SubscriptionsModifyPushConfigCall) Fields(s ...googleapi.Field) *SubscriptionsModifyPushConfigCall
- func (c *SubscriptionsModifyPushConfigCall) Header() http.Header
- type SubscriptionsPullBatchCall
- func (c *SubscriptionsPullBatchCall) Context(ctx context.Context) *SubscriptionsPullBatchCall
- func (c *SubscriptionsPullBatchCall) Do(opts ...googleapi.CallOption) (*PullBatchResponse, error)
- func (c *SubscriptionsPullBatchCall) Fields(s ...googleapi.Field) *SubscriptionsPullBatchCall
- func (c *SubscriptionsPullBatchCall) Header() http.Header
- type SubscriptionsPullCall
- func (c *SubscriptionsPullCall) Context(ctx context.Context) *SubscriptionsPullCall
- func (c *SubscriptionsPullCall) Do(opts ...googleapi.CallOption) (*PullResponse, error)
- func (c *SubscriptionsPullCall) Fields(s ...googleapi.Field) *SubscriptionsPullCall
- func (c *SubscriptionsPullCall) Header() http.Header
- 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
- func (c *TopicsGetCall) Context(ctx context.Context) *TopicsGetCall
- func (c *TopicsGetCall) Do(opts ...googleapi.CallOption) (*Topic, error)
- func (c *TopicsGetCall) Fields(s ...googleapi.Field) *TopicsGetCall
- func (c *TopicsGetCall) Header() http.Header
- func (c *TopicsGetCall) IfNoneMatch(entityTag string) *TopicsGetCall
- type TopicsListCall
- func (c *TopicsListCall) Context(ctx context.Context) *TopicsListCall
- func (c *TopicsListCall) Do(opts ...googleapi.CallOption) (*ListTopicsResponse, error)
- func (c *TopicsListCall) Fields(s ...googleapi.Field) *TopicsListCall
- func (c *TopicsListCall) Header() http.Header
- func (c *TopicsListCall) IfNoneMatch(entityTag string) *TopicsListCall
- func (c *TopicsListCall) MaxResults(maxResults int64) *TopicsListCall
- func (c *TopicsListCall) PageToken(pageToken string) *TopicsListCall
- func (c *TopicsListCall) Pages(ctx context.Context, f func(*ListTopicsResponse) error) error
- func (c *TopicsListCall) Query(query string) *TopicsListCall
- type TopicsPublishBatchCall
- func (c *TopicsPublishBatchCall) Context(ctx context.Context) *TopicsPublishBatchCall
- func (c *TopicsPublishBatchCall) Do(opts ...googleapi.CallOption) (*PublishBatchResponse, error)
- func (c *TopicsPublishBatchCall) Fields(s ...googleapi.Field) *TopicsPublishBatchCall
- func (c *TopicsPublishBatchCall) Header() http.Header
- 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 (// See, edit, configure, and delete your Google Cloud data and see the email// address for your Google Account.CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"// View and manage Pub/Sub topics and subscriptionsPubsubScope = "https://www.googleapis.com/auth/pubsub")
OAuth2 scopes used by this API.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeAcknowledgeRequest¶
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.Subscriptionstring `json:"subscription,omitempty"`// ForceSendFields is a list of field names (e.g. "AckId") to unconditionally// include in API requests. By default, fields with empty or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "AckId") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}AcknowledgeRequest: Request for the Acknowledge method.
func (AcknowledgeRequest)MarshalJSON¶
func (sAcknowledgeRequest) MarshalJSON() ([]byte,error)
typeEmpty¶
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 duplicatedempty messages in your project. A typical example is to use it as argumentor the return value of a service API. For instance: service Foo { rpc Bar(proto2.Empty) returns (proto2.Empty) { }; }; BEGIN GOOGLE-INTERNAL Thedifference between this one and net/rpc/empty-message.proto is that 1) Thegenerated message here is in proto2 C++ API. 2) The proto2.Empty has minimumdependencies (no message_set or net/rpc dependencies) END GOOGLE-INTERNAL
typeLabel¶
type Label struct {// Key: The key of a label is a syntactically valid URL (as perRFC 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 inRFC 1738. Example key:// spanner.google.com/universeKeystring `json:"key,omitempty"`// NumValue: An integer value.NumValueint64 `json:"numValue,omitempty,string"`// StrValue: A string value.StrValuestring `json:"strValue,omitempty"`// ForceSendFields is a list of field names (e.g. "Key") to unconditionally// include in API requests. By default, fields with empty or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "Key") to include in API requests// with the JSON null value. By default, fields with empty values are omitted// from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}Label: A key-value pair applied to a given object.
func (Label)MarshalJSON¶
typeListSubscriptionsResponse¶
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.NextPageTokenstring `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 or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "NextPageToken") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}ListSubscriptionsResponse: Response for the ListSubscriptions method.
func (ListSubscriptionsResponse)MarshalJSON¶
func (sListSubscriptionsResponse) MarshalJSON() ([]byte,error)
typeListTopicsResponse¶
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.NextPageTokenstring `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 or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "NextPageToken") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}ListTopicsResponse: Response for the ListTopics method.
func (ListTopicsResponse)MarshalJSON¶
func (sListTopicsResponse) MarshalJSON() ([]byte,error)
typeModifyAckDeadlineRequest¶
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.AckDeadlineSecondsint64 `json:"ackDeadlineSeconds,omitempty"`// AckId: The acknowledgment ID. Either this or ack_ids must be populated, not// both.AckIdstring `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.Subscriptionstring `json:"subscription,omitempty"`// ForceSendFields is a list of field names (e.g. "AckDeadlineSeconds") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "AckDeadlineSeconds") to include// in API requests with the JSON null value. By default, fields with empty// values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}ModifyAckDeadlineRequest: Request for the ModifyAckDeadline method.
func (ModifyAckDeadlineRequest)MarshalJSON¶
func (sModifyAckDeadlineRequest) MarshalJSON() ([]byte,error)
typeModifyPushConfigRequest¶
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.Subscriptionstring `json:"subscription,omitempty"`// ForceSendFields is a list of field names (e.g. "PushConfig") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "PushConfig") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}ModifyPushConfigRequest: Request for the ModifyPushConfig method.
func (ModifyPushConfigRequest)MarshalJSON¶
func (sModifyPushConfigRequest) MarshalJSON() ([]byte,error)
typePublishBatchRequest¶
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.Topicstring `json:"topic,omitempty"`// ForceSendFields is a list of field names (e.g. "Messages") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "Messages") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}PublishBatchRequest: Request for the PublishBatch method.
func (PublishBatchRequest)MarshalJSON¶
func (sPublishBatchRequest) MarshalJSON() ([]byte,error)
typePublishBatchResponse¶
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 or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "MessageIds") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}PublishBatchResponse: Response for the PublishBatch method.
func (PublishBatchResponse)MarshalJSON¶
func (sPublishBatchResponse) MarshalJSON() ([]byte,error)
typePublishRequest¶
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.Topicstring `json:"topic,omitempty"`// ForceSendFields is a list of field names (e.g. "Message") to unconditionally// include in API requests. By default, fields with empty or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "Message") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}PublishRequest: Request for the Publish method.
func (PublishRequest)MarshalJSON¶
func (sPublishRequest) MarshalJSON() ([]byte,error)
typePubsubEvent¶
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.)Deletedbool `json:"deleted,omitempty"`// Message: A received message.Message *PubsubMessage `json:"message,omitempty"`// Subscription: The subscription that received the event.Subscriptionstring `json:"subscription,omitempty"`// Truncated: Indicates that this subscription has been truncated.Truncatedbool `json:"truncated,omitempty"`// ForceSendFields is a list of field names (e.g. "Deleted") to unconditionally// include in API requests. By default, fields with empty or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "Deleted") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}PubsubEvent: An event indicating a received message or truncation event.
func (PubsubEvent)MarshalJSON¶
func (sPubsubEvent) MarshalJSON() ([]byte,error)
typePubsubMessage¶
type PubsubMessage struct {// Data: The message payload.Datastring `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.MessageIdstring `json:"messageId,omitempty"`// PublishTime: The time at which the message was published. The time is// milliseconds since the UNIX epoch.PublishTimeint64 `json:"publishTime,omitempty,string"`// ForceSendFields is a list of field names (e.g. "Data") to unconditionally// include in API requests. By default, fields with empty or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "Data") to include in API requests// with the JSON null value. By default, fields with empty values are omitted// from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}PubsubMessage: A message data and its labels.
func (PubsubMessage)MarshalJSON¶
func (sPubsubMessage) MarshalJSON() ([]byte,error)
typePullBatchRequest¶
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.MaxEventsint64 `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.ReturnImmediatelybool `json:"returnImmediately,omitempty"`// Subscription: The subscription from which messages should be pulled.Subscriptionstring `json:"subscription,omitempty"`// ForceSendFields is a list of field names (e.g. "MaxEvents") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "MaxEvents") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}PullBatchRequest: Request for the PullBatch method.
func (PullBatchRequest)MarshalJSON¶
func (sPullBatchRequest) MarshalJSON() ([]byte,error)
typePullBatchResponse¶
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 or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "PullResponses") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}PullBatchResponse: Response for the PullBatch method.
func (PullBatchResponse)MarshalJSON¶
func (sPullBatchResponse) MarshalJSON() ([]byte,error)
typePullRequest¶
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.ReturnImmediatelybool `json:"returnImmediately,omitempty"`// Subscription: The subscription from which a message should be pulled.Subscriptionstring `json:"subscription,omitempty"`// ForceSendFields is a list of field names (e.g. "ReturnImmediately") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "ReturnImmediately") to include in// API requests with the JSON null value. By default, fields with empty values// are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}PullRequest: Request for the Pull method.
func (PullRequest)MarshalJSON¶
func (sPullRequest) MarshalJSON() ([]byte,error)
typePullResponse¶
type PullResponse struct {// AckId: This ID must be used to acknowledge the received event or message.AckIdstring `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 or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "AckId") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}PullResponse: Either a PubsubMessage or a truncation event. One of these twomust be populated.
func (PullResponse)MarshalJSON¶
func (sPullResponse) MarshalJSON() ([]byte,error)
typePushConfig¶
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".PushEndpointstring `json:"pushEndpoint,omitempty"`// ForceSendFields is a list of field names (e.g. "PushEndpoint") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "PushEndpoint") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}PushConfig: Configuration for a push delivery endpoint.
func (PushConfig)MarshalJSON¶
func (sPushConfig) MarshalJSON() ([]byte,error)
typeService¶
type Service struct {BasePathstring// API endpoint base URLUserAgentstring// optional additional User-Agent fragmentSubscriptions *SubscriptionsServiceTopics *TopicsService// contains filtered or unexported fields} funcNewdeprecated
New creates a new Service. It uses the provided http.Client for requests.
Deprecated: please use NewService instead.To provide a custom HTTP client, use option.WithHTTPClient.If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
funcNewService¶added inv0.3.0
NewService creates a new Service.
typeSubscription¶
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).AckDeadlineSecondsint64 `json:"ackDeadlineSeconds,omitempty"`// Name: Name of the subscription.Namestring `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.Topicstring `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 or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "AckDeadlineSeconds") to include// in API requests with the JSON null value. By default, fields with empty// values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}Subscription: A subscription resource.
func (Subscription)MarshalJSON¶
func (sSubscription) MarshalJSON() ([]byte,error)
typeSubscriptionsAcknowledgeCall¶
type SubscriptionsAcknowledgeCall struct {// contains filtered or unexported fields}func (*SubscriptionsAcknowledgeCall)Context¶
func (c *SubscriptionsAcknowledgeCall) Context(ctxcontext.Context) *SubscriptionsAcknowledgeCall
Context sets the context to be used in this call's Do method.
func (*SubscriptionsAcknowledgeCall)Do¶
func (c *SubscriptionsAcknowledgeCall) Do(opts ...googleapi.CallOption) (*Empty,error)
Do executes the "pubsub.subscriptions.acknowledge" call.Any non-2xx status code is an error. Response headers are in either*Empty.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.
func (*SubscriptionsAcknowledgeCall)Fields¶
func (c *SubscriptionsAcknowledgeCall) Fields(s ...googleapi.Field) *SubscriptionsAcknowledgeCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*SubscriptionsAcknowledgeCall)Header¶
func (c *SubscriptionsAcknowledgeCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
typeSubscriptionsCreateCall¶
type SubscriptionsCreateCall struct {// contains filtered or unexported fields}func (*SubscriptionsCreateCall)Context¶
func (c *SubscriptionsCreateCall) Context(ctxcontext.Context) *SubscriptionsCreateCall
Context sets the context to be used in this call's Do method.
func (*SubscriptionsCreateCall)Do¶
func (c *SubscriptionsCreateCall) Do(opts ...googleapi.CallOption) (*Subscription,error)
Do executes the "pubsub.subscriptions.create" call.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 checkwhether the returned error was because http.StatusNotModified was returned.
func (*SubscriptionsCreateCall)Fields¶
func (c *SubscriptionsCreateCall) Fields(s ...googleapi.Field) *SubscriptionsCreateCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*SubscriptionsCreateCall)Header¶
func (c *SubscriptionsCreateCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
typeSubscriptionsDeleteCall¶
type SubscriptionsDeleteCall struct {// contains filtered or unexported fields}func (*SubscriptionsDeleteCall)Context¶
func (c *SubscriptionsDeleteCall) Context(ctxcontext.Context) *SubscriptionsDeleteCall
Context sets the context to be used in this call's Do method.
func (*SubscriptionsDeleteCall)Do¶
func (c *SubscriptionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty,error)
Do executes the "pubsub.subscriptions.delete" call.Any non-2xx status code is an error. Response headers are in either*Empty.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.
func (*SubscriptionsDeleteCall)Fields¶
func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*SubscriptionsDeleteCall)Header¶
func (c *SubscriptionsDeleteCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
typeSubscriptionsGetCall¶
type SubscriptionsGetCall struct {// contains filtered or unexported fields}func (*SubscriptionsGetCall)Context¶
func (c *SubscriptionsGetCall) Context(ctxcontext.Context) *SubscriptionsGetCall
Context sets the context to be used in this call's Do method.
func (*SubscriptionsGetCall)Do¶
func (c *SubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*Subscription,error)
Do executes the "pubsub.subscriptions.get" call.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 checkwhether the returned error was because http.StatusNotModified was returned.
func (*SubscriptionsGetCall)Fields¶
func (c *SubscriptionsGetCall) Fields(s ...googleapi.Field) *SubscriptionsGetCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*SubscriptionsGetCall)Header¶
func (c *SubscriptionsGetCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
func (*SubscriptionsGetCall)IfNoneMatch¶
func (c *SubscriptionsGetCall) IfNoneMatch(entityTagstring) *SubscriptionsGetCall
IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.
typeSubscriptionsListCall¶
type SubscriptionsListCall struct {// contains filtered or unexported fields}func (*SubscriptionsListCall)Context¶
func (c *SubscriptionsListCall) Context(ctxcontext.Context) *SubscriptionsListCall
Context sets the context to be used in this call's Do method.
func (*SubscriptionsListCall)Do¶
func (c *SubscriptionsListCall) Do(opts ...googleapi.CallOption) (*ListSubscriptionsResponse,error)
Do executes the "pubsub.subscriptions.list" call.Any non-2xx status code is an error. Response headers are in either*ListSubscriptionsResponse.ServerResponse.Header or (if a response wasreturned at all) in error.(*googleapi.Error).Header. Usegoogleapi.IsNotModified to check whether the returned error was becausehttp.StatusNotModified was returned.
func (*SubscriptionsListCall)Fields¶
func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*SubscriptionsListCall)Header¶
func (c *SubscriptionsListCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
func (*SubscriptionsListCall)IfNoneMatch¶
func (c *SubscriptionsListCall) IfNoneMatch(entityTagstring) *SubscriptionsListCall
IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.
func (*SubscriptionsListCall)MaxResults¶
func (c *SubscriptionsListCall) MaxResults(maxResultsint64) *SubscriptionsListCall
MaxResults sets the optional parameter "maxResults": Maximum number ofsubscriptions to return.
func (*SubscriptionsListCall)PageToken¶
func (c *SubscriptionsListCall) PageToken(pageTokenstring) *SubscriptionsListCall
PageToken sets the optional parameter "pageToken": The value obtained in thelast ListSubscriptionsResponse for continuation.
func (*SubscriptionsListCall)Pages¶
func (c *SubscriptionsListCall) Pages(ctxcontext.Context, f func(*ListSubscriptionsResponse)error)error
Pages invokes f for each page of results.A non-nil error returned from f will halt the iteration.The provided context supersedes any context provided to the Context method.
func (*SubscriptionsListCall)Query¶
func (c *SubscriptionsListCall) Query(querystring) *SubscriptionsListCall
Query sets the optional parameter "query": A valid label query expression.
typeSubscriptionsModifyAckDeadlineCall¶
type SubscriptionsModifyAckDeadlineCall struct {// contains filtered or unexported fields}func (*SubscriptionsModifyAckDeadlineCall)Context¶
func (c *SubscriptionsModifyAckDeadlineCall) Context(ctxcontext.Context) *SubscriptionsModifyAckDeadlineCall
Context sets the context to be used in this call's Do method.
func (*SubscriptionsModifyAckDeadlineCall)Do¶
func (c *SubscriptionsModifyAckDeadlineCall) Do(opts ...googleapi.CallOption) (*Empty,error)
Do executes the "pubsub.subscriptions.modifyAckDeadline" call.Any non-2xx status code is an error. Response headers are in either*Empty.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.
func (*SubscriptionsModifyAckDeadlineCall)Fields¶
func (c *SubscriptionsModifyAckDeadlineCall) Fields(s ...googleapi.Field) *SubscriptionsModifyAckDeadlineCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*SubscriptionsModifyAckDeadlineCall)Header¶
func (c *SubscriptionsModifyAckDeadlineCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
typeSubscriptionsModifyPushConfigCall¶
type SubscriptionsModifyPushConfigCall struct {// contains filtered or unexported fields}func (*SubscriptionsModifyPushConfigCall)Context¶
func (c *SubscriptionsModifyPushConfigCall) Context(ctxcontext.Context) *SubscriptionsModifyPushConfigCall
Context sets the context to be used in this call's Do method.
func (*SubscriptionsModifyPushConfigCall)Do¶
func (c *SubscriptionsModifyPushConfigCall) Do(opts ...googleapi.CallOption) (*Empty,error)
Do executes the "pubsub.subscriptions.modifyPushConfig" call.Any non-2xx status code is an error. Response headers are in either*Empty.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.
func (*SubscriptionsModifyPushConfigCall)Fields¶
func (c *SubscriptionsModifyPushConfigCall) Fields(s ...googleapi.Field) *SubscriptionsModifyPushConfigCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*SubscriptionsModifyPushConfigCall)Header¶
func (c *SubscriptionsModifyPushConfigCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
typeSubscriptionsPullBatchCall¶
type SubscriptionsPullBatchCall struct {// contains filtered or unexported fields}func (*SubscriptionsPullBatchCall)Context¶
func (c *SubscriptionsPullBatchCall) Context(ctxcontext.Context) *SubscriptionsPullBatchCall
Context sets the context to be used in this call's Do method.
func (*SubscriptionsPullBatchCall)Do¶
func (c *SubscriptionsPullBatchCall) Do(opts ...googleapi.CallOption) (*PullBatchResponse,error)
Do executes the "pubsub.subscriptions.pullBatch" call.Any non-2xx status code is an error. Response headers are in either*PullBatchResponse.ServerResponse.Header or (if a response was returned atall) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified tocheck whether the returned error was because http.StatusNotModified wasreturned.
func (*SubscriptionsPullBatchCall)Fields¶
func (c *SubscriptionsPullBatchCall) Fields(s ...googleapi.Field) *SubscriptionsPullBatchCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*SubscriptionsPullBatchCall)Header¶
func (c *SubscriptionsPullBatchCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
typeSubscriptionsPullCall¶
type SubscriptionsPullCall struct {// contains filtered or unexported fields}func (*SubscriptionsPullCall)Context¶
func (c *SubscriptionsPullCall) Context(ctxcontext.Context) *SubscriptionsPullCall
Context sets the context to be used in this call's Do method.
func (*SubscriptionsPullCall)Do¶
func (c *SubscriptionsPullCall) Do(opts ...googleapi.CallOption) (*PullResponse,error)
Do executes the "pubsub.subscriptions.pull" call.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 checkwhether the returned error was because http.StatusNotModified was returned.
func (*SubscriptionsPullCall)Fields¶
func (c *SubscriptionsPullCall) Fields(s ...googleapi.Field) *SubscriptionsPullCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*SubscriptionsPullCall)Header¶
func (c *SubscriptionsPullCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
typeSubscriptionsService¶
type SubscriptionsService struct {// contains filtered or unexported fields}funcNewSubscriptionsService¶
func NewSubscriptionsService(s *Service) *SubscriptionsService
func (*SubscriptionsService)Acknowledge¶
func (r *SubscriptionsService) Acknowledge(acknowledgerequest *AcknowledgeRequest) *SubscriptionsAcknowledgeCall
Acknowledge: Acknowledges a particular received message: the Pub/Sub systemcan remove the given message from the subscription. Acknowledging a messagewhose Ack deadline has expired may succeed, but the message could have beenalready redelivered. Acknowledging a message more than once will not resultin 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. Ifthe subscription already exists, returns ALREADY_EXISTS. If thecorresponding topic doesn't exist, returns NOT_FOUND. If the name is notprovided in the request, the server will assign a random name for thissubscription on the same project as the topic.
func (*SubscriptionsService)Delete¶
func (r *SubscriptionsService) Delete(subscriptionstring) *SubscriptionsDeleteCall
Delete: Deletes an existing subscription. All pending messages in thesubscription are immediately dropped. Calls to Pull after deletion willreturn NOT_FOUND.
- subscription: The subscription to delete.
func (*SubscriptionsService)Get¶
func (r *SubscriptionsService) Get(subscriptionstring) *SubscriptionsGetCall
Get: Gets the configuration details of a subscription.
- subscription: The name of the subscription to get.
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 apull request.
func (*SubscriptionsService)ModifyPushConfig¶
func (r *SubscriptionsService) ModifyPushConfig(modifypushconfigrequest *ModifyPushConfigRequest) *SubscriptionsModifyPushConfigCall
ModifyPushConfig: Modifies the PushConfig for a specified subscription. Thismethod can be used to suspend the flow of messages to an endpoint byclearing the PushConfig field in the request. Messages will be accumulatedfor delivery even if no push configuration is defined or while theconfiguration 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 returnsFAILED_PRECONDITION. The system is free to return an UNAVAILABLE error if nomessages are available in a reasonable amount of time (to reduce systemload).
func (*SubscriptionsService)PullBatch¶
func (r *SubscriptionsService) PullBatch(pullbatchrequest *PullBatchRequest) *SubscriptionsPullBatchCall
PullBatch: Pulls messages from the server. Returns an empty list if thereare no messages available in the backlog. The system is free to returnUNAVAILABLE if there are too many pull requests outstanding for the givensubscription.
typeTopic¶
type Topic struct {// Name: Name of the topic.Namestring `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 or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "Name") to include in API requests// with the JSON null value. By default, fields with empty values are omitted// from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}Topic: A topic resource.
func (Topic)MarshalJSON¶
typeTopicsCreateCall¶
type TopicsCreateCall struct {// contains filtered or unexported fields}func (*TopicsCreateCall)Context¶
func (c *TopicsCreateCall) Context(ctxcontext.Context) *TopicsCreateCall
Context sets the context to be used in this call's Do method.
func (*TopicsCreateCall)Do¶
func (c *TopicsCreateCall) Do(opts ...googleapi.CallOption) (*Topic,error)
Do executes the "pubsub.topics.create" call.Any non-2xx status code is an error. Response headers are in either*Topic.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.
func (*TopicsCreateCall)Fields¶
func (c *TopicsCreateCall) Fields(s ...googleapi.Field) *TopicsCreateCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*TopicsCreateCall)Header¶
func (c *TopicsCreateCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
typeTopicsDeleteCall¶
type TopicsDeleteCall struct {// contains filtered or unexported fields}func (*TopicsDeleteCall)Context¶
func (c *TopicsDeleteCall) Context(ctxcontext.Context) *TopicsDeleteCall
Context sets the context to be used in this call's Do method.
func (*TopicsDeleteCall)Do¶
func (c *TopicsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty,error)
Do executes the "pubsub.topics.delete" call.Any non-2xx status code is an error. Response headers are in either*Empty.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.
func (*TopicsDeleteCall)Fields¶
func (c *TopicsDeleteCall) Fields(s ...googleapi.Field) *TopicsDeleteCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*TopicsDeleteCall)Header¶
func (c *TopicsDeleteCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
typeTopicsGetCall¶
type TopicsGetCall struct {// contains filtered or unexported fields}func (*TopicsGetCall)Context¶
func (c *TopicsGetCall) Context(ctxcontext.Context) *TopicsGetCall
Context sets the context to be used in this call's Do method.
func (*TopicsGetCall)Do¶
func (c *TopicsGetCall) Do(opts ...googleapi.CallOption) (*Topic,error)
Do executes the "pubsub.topics.get" call.Any non-2xx status code is an error. Response headers are in either*Topic.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether 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. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*TopicsGetCall)Header¶
func (c *TopicsGetCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
func (*TopicsGetCall)IfNoneMatch¶
func (c *TopicsGetCall) IfNoneMatch(entityTagstring) *TopicsGetCall
IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.
typeTopicsListCall¶
type TopicsListCall struct {// contains filtered or unexported fields}func (*TopicsListCall)Context¶
func (c *TopicsListCall) Context(ctxcontext.Context) *TopicsListCall
Context sets the context to be used in this call's Do method.
func (*TopicsListCall)Do¶
func (c *TopicsListCall) Do(opts ...googleapi.CallOption) (*ListTopicsResponse,error)
Do executes the "pubsub.topics.list" call.Any non-2xx status code is an error. Response headers are in either*ListTopicsResponse.ServerResponse.Header or (if a response was returned atall) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified tocheck whether the returned error was because http.StatusNotModified wasreturned.
func (*TopicsListCall)Fields¶
func (c *TopicsListCall) Fields(s ...googleapi.Field) *TopicsListCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*TopicsListCall)Header¶
func (c *TopicsListCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
func (*TopicsListCall)IfNoneMatch¶
func (c *TopicsListCall) IfNoneMatch(entityTagstring) *TopicsListCall
IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.
func (*TopicsListCall)MaxResults¶
func (c *TopicsListCall) MaxResults(maxResultsint64) *TopicsListCall
MaxResults sets the optional parameter "maxResults": Maximum number oftopics to return.
func (*TopicsListCall)PageToken¶
func (c *TopicsListCall) PageToken(pageTokenstring) *TopicsListCall
PageToken sets the optional parameter "pageToken": The value obtained in thelast ListTopicsResponse for continuation.
func (*TopicsListCall)Pages¶
func (c *TopicsListCall) Pages(ctxcontext.Context, f func(*ListTopicsResponse)error)error
Pages invokes f for each page of results.A non-nil error returned from f will halt the iteration.The provided context supersedes any context provided to the Context method.
func (*TopicsListCall)Query¶
func (c *TopicsListCall) Query(querystring) *TopicsListCall
Query sets the optional parameter "query": A valid label query expression.
typeTopicsPublishBatchCall¶
type TopicsPublishBatchCall struct {// contains filtered or unexported fields}func (*TopicsPublishBatchCall)Context¶
func (c *TopicsPublishBatchCall) Context(ctxcontext.Context) *TopicsPublishBatchCall
Context sets the context to be used in this call's Do method.
func (*TopicsPublishBatchCall)Do¶
func (c *TopicsPublishBatchCall) Do(opts ...googleapi.CallOption) (*PublishBatchResponse,error)
Do executes the "pubsub.topics.publishBatch" call.Any non-2xx status code is an error. Response headers are in either*PublishBatchResponse.ServerResponse.Header or (if a response was returnedat all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified tocheck whether the returned error was because http.StatusNotModified wasreturned.
func (*TopicsPublishBatchCall)Fields¶
func (c *TopicsPublishBatchCall) Fields(s ...googleapi.Field) *TopicsPublishBatchCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*TopicsPublishBatchCall)Header¶
func (c *TopicsPublishBatchCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
typeTopicsPublishCall¶
type TopicsPublishCall struct {// contains filtered or unexported fields}func (*TopicsPublishCall)Context¶
func (c *TopicsPublishCall) Context(ctxcontext.Context) *TopicsPublishCall
Context sets the context to be used in this call's Do method.
func (*TopicsPublishCall)Do¶
func (c *TopicsPublishCall) Do(opts ...googleapi.CallOption) (*Empty,error)
Do executes the "pubsub.topics.publish" call.Any non-2xx status code is an error. Response headers are in either*Empty.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.
func (*TopicsPublishCall)Fields¶
func (c *TopicsPublishCall) Fields(s ...googleapi.Field) *TopicsPublishCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*TopicsPublishCall)Header¶
func (c *TopicsPublishCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
typeTopicsService¶
type TopicsService struct {// contains filtered or unexported fields}funcNewTopicsService¶
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(topicstring) *TopicsDeleteCall
Delete: Deletes the topic with the given name. Returns NOT_FOUND if thetopic does not exist. After a topic is deleted, a new topic may be createdwith the same name.
- topic: Name of the topic to delete.
func (*TopicsService)Get¶
func (r *TopicsService) Get(topicstring) *TopicsGetCall
Get: Gets the configuration of a topic. Since the topic only has the nameattribute, this method is only useful to check the existence of a topic. Ifother attributes are added in the future, they will be returned here.
- topic: The name of the topic to get.
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 doesnot exist.
func (*TopicsService)PublishBatch¶
func (r *TopicsService) PublishBatch(publishbatchrequest *PublishBatchRequest) *TopicsPublishBatchCall
PublishBatch: Adds one or more messages to the topic. Returns NOT_FOUND ifthe topic does not exist.