pubsub

package
v1.64.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Copyright 2024 Google LLC. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Package pubsub defines operations in the declarative SDK.

Copyright 2024 Google LLC. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Package pubsub contains handwritten support code for the PubSub service.

Copyright 2024 Google LLC. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 Google LLC. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 Google LLC. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const TopicMaxPage = -1

Variables

View Source
var YAML_topic = []byte("info:\n  title: Pubsub/Topic\n  description: The Pubsub Topic resource\n  x-dcl-struct-name: Topic\n  x-dcl-has-iam: false\npaths:\n  get:\n    description: The function used to get information about a Topic\n    parameters:\n    - name: topic\n      required: true\n      description: A full instance of a Topic\n  apply:\n    description: The function used to apply information about a Topic\n    parameters:\n    - name: topic\n      required: true\n      description: A full instance of a Topic\n  delete:\n    description: The function used to delete a Topic\n    parameters:\n    - name: topic\n      required: true\n      description: A full instance of a Topic\n  deleteAll:\n    description: The function used to delete all Topic\n    parameters:\n    - name: project\n      required: true\n      schema:\n        type: string\n  list:\n    description: The function used to list information about many Topic\n    parameters:\n    - name: project\n      required: true\n      schema:\n        type: string\ncomponents:\n  schemas:\n    Topic:\n      title: Topic\n      x-dcl-id: projects/{{project}}/topics/{{name}}\n      x-dcl-parent-container: project\n      x-dcl-labels: labels\n      x-dcl-has-create: true\n      x-dcl-has-iam: false\n      x-dcl-read-timeout: 0\n      x-dcl-apply-timeout: 0\n      x-dcl-delete-timeout: 0\n      type: object\n      required:\n      - name\n      - project\n      properties:\n        kmsKeyName:\n          type: string\n          x-dcl-go-name: KmsKeyName\n          description: 'The resource name of the Cloud KMS CryptoKey to be used to\n            protect access to messages published on this topic. Your project''s Pub/Sub\n            service account (`service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com`)\n            must have `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature.  The\n            expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*` '\n        labels:\n          type: object\n          additionalProperties:\n            type: string\n          x-dcl-go-name: Labels\n          description: 'A set of key/value label pairs to assign to this Topic. '\n        messageStoragePolicy:\n          type: object\n          x-dcl-go-name: MessageStoragePolicy\n          x-dcl-go-type: TopicMessageStoragePolicy\n          description: 'Policy constraining the set of Google Cloud Platform regions\n            where messages published to the topic may be stored. If not present, then\n            no constraints are in effect. '\n          x-dcl-server-default: true\n          properties:\n            allowedPersistenceRegions:\n              type: array\n              x-dcl-go-name: AllowedPersistenceRegions\n              description: 'A list of IDs of GCP regions where messages that are published\n                to the topic may be persisted in storage. Messages published by publishers\n                running in non-allowed GCP regions (or running outside of GCP altogether)\n                will be routed for storage in one of the allowed regions. An empty\n                list means that no regions are allowed, and is not a valid configuration. '\n              x-dcl-send-empty: true\n              x-dcl-list-type: set\n              items:\n                type: string\n                x-dcl-go-type: string\n        name:\n          type: string\n          x-dcl-go-name: Name\n          description: Name of the topic.\n          x-kubernetes-immutable: true\n          x-dcl-parameter: true\n        project:\n          type: string\n          x-dcl-go-name: Project\n          description: The project id of the resource.\n          x-kubernetes-immutable: true\n          x-dcl-references:\n          - resource: Cloudresourcemanager/Project\n            field: name\n            parent: true\n          x-dcl-parameter: true\n")

blaze-out/k8-fastbuild/genfiles/cloud/graphite/mmv2/services/google/pubsub/topic.yaml

Functions

func DCLTopicSchema added in v1.10.3

func DCLTopicSchema() *dcl.Schema

Types

type Client

type Client struct {
	Config *dcl.Config
}

The Client is the base struct of all operations. This will receive the Get, Delete, List, and Apply operations on all resources.

func NewClient

func NewClient(c *dcl.Config) *Client

NewClient creates a client that retries all operations a few times each.

func (*Client) ApplyTopic

func (c *Client) ApplyTopic(ctx context.Context, rawDesired *Topic, opts ...dcl.ApplyOption) (*Topic, error)

func (*Client) DeleteAllTopic

func (c *Client) DeleteAllTopic(ctx context.Context, project string, filter func(*Topic) bool) error

DeleteAllTopic deletes all resources that the filter functions returns true on.

func (*Client) DeleteTopic

func (c *Client) DeleteTopic(ctx context.Context, r *Topic) error

func (*Client) GetTopic

func (c *Client) GetTopic(ctx context.Context, r *Topic) (*Topic, error)

func (*Client) ListTopic

func (c *Client) ListTopic(ctx context.Context, project string) (*TopicList, error)

func (*Client) ListTopicWithMaxResults

func (c *Client) ListTopicWithMaxResults(ctx context.Context, project string, pageSize int32) (*TopicList, error)

type Topic

type Topic struct {
	Name                 *string                    `json:"name"`
	KmsKeyName           *string                    `json:"kmsKeyName"`
	Labels               map[string]string          `json:"labels"`
	MessageStoragePolicy *TopicMessageStoragePolicy `json:"messageStoragePolicy"`
	Project              *string                    `json:"project"`
}

func (*Topic) Describe

func (r *Topic) Describe() dcl.ServiceTypeVersion

Describe returns a simple description of this resource to ensure that automated tools can identify it.

func (*Topic) ID

func (r *Topic) ID() (string, error)

func (*Topic) String

func (r *Topic) String() string

type TopicList

type TopicList struct {
	Items []*Topic
	// contains filtered or unexported fields
}

func (*TopicList) HasNext

func (l *TopicList) HasNext() bool

func (*TopicList) Next

func (l *TopicList) Next(ctx context.Context, c *Client) error

type TopicMessageStoragePolicy

type TopicMessageStoragePolicy struct {
	AllowedPersistenceRegions []string `json:"allowedPersistenceRegions"`
	// contains filtered or unexported fields
}
var EmptyTopicMessageStoragePolicy *TopicMessageStoragePolicy = &TopicMessageStoragePolicy{empty: true}

This object is used to assert a desired state where this TopicMessageStoragePolicy is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.

func (*TopicMessageStoragePolicy) Empty

func (r *TopicMessageStoragePolicy) Empty() bool

func (*TopicMessageStoragePolicy) HashCode

func (r *TopicMessageStoragePolicy) HashCode() string

func (*TopicMessageStoragePolicy) String

func (r *TopicMessageStoragePolicy) String() string

func (*TopicMessageStoragePolicy) UnmarshalJSON

func (r *TopicMessageStoragePolicy) UnmarshalJSON(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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