pubsub

package
v0.0.0-...-92ef7d0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PubSubClientWrapper

type PubSubClientWrapper struct {
	// contains filtered or unexported fields
}

func GetPubSubInstance

func GetPubSubInstance() *PubSubClientWrapper

func (*PubSubClientWrapper) Close

func (c *PubSubClientWrapper) Close() error

func (*PubSubClientWrapper) CreateBigQuerySubscription

func (c *PubSubClientWrapper) CreateBigQuerySubscription(id string, topic *pubsub.Topic, table string) error

Pub/Sub creates and maintains a service account for each project in the format service-project-number@gcp-sa-pubsub.iam.gserviceaccount.com. To create a BigQuery subscription, the Pub/Sub service account must have permission to write to the specific BigQuery table and to read the table metadata. Grant the BigQuery Data Editor (roles/bigquery.dataEditor) role and the BigQuery Metadata Viewer (roles/bigquery.metadataViewer) role to the Pub/Sub service account. Steps: 1. In the Google Cloud console, go to the IAM -> Click Grant access 2. In the Add Principals section, enter the name of your Pub/Sub service account. The format of the service account is service-project-number@gcp-sa-pubsub.iam.gserviceaccount.com. For example, for a project with project-number=112233445566, the service account is of the format service-112233445566@gcp-sa-pubsub.iam.gserviceaccount.com. 3. In the Assign Roles section, click Add roles, and add: - BigQuery Data Editor role - BigQuery Metadata Viewer role 4. Click Save

func (*PubSubClientWrapper) CreateTopicWithSchema

func (c *PubSubClientWrapper) CreateTopicWithSchema(topic, schema string) (*pubsub.Topic, error)

func (*PubSubClientWrapper) DeleteTopic

func (c *PubSubClientWrapper) DeleteTopic(id string) error

func (*PubSubClientWrapper) DetachSubscription

func (c *PubSubClientWrapper) DetachSubscription(sub string) error

func (*PubSubClientWrapper) GetTopic

func (c *PubSubClientWrapper) GetTopic(id string) *pubsub.Topic

type PubSubSchemaClientWrapper

type PubSubSchemaClientWrapper struct {
	// contains filtered or unexported fields
}

func GetPubSubSchemaInstance

func GetPubSubSchemaInstance() *PubSubSchemaClientWrapper

func (*PubSubSchemaClientWrapper) Close

func (c *PubSubSchemaClientWrapper) Close() error

func (*PubSubSchemaClientWrapper) CreateProtoBufSchema

func (c *PubSubSchemaClientWrapper) CreateProtoBufSchema(schema, protoFile string) error

CreateProtoBufSchema creates a schema resource from a schema proto file

func (*PubSubSchemaClientWrapper) DeleteSchema

func (c *PubSubSchemaClientWrapper) DeleteSchema(id string) error

Jump to

Keyboard shortcuts

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