Version: v0.1.2 Latest Latest

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

Go to latest
Published: Aug 2, 2020 License: Apache-2.0 Imports: 6 Imported by: 0



Package gcpdriver contains Google Cloud Pub/Sub driver for unifrost.StreamHandler



This section is empty.


This section is empty.


This section is empty.


type Client

type Client struct {
	// contains filtered or unexported fields

Client handles the subscriptions to the GCP PubSub broker topics

func NewClient

func NewClient(ctx context.Context, conn *grpc.ClientConn, projectID gcp.ProjectID, opts ...Option) (*Client, error)

NewClient returns *gcpdriver.Client, also creates a GCP pub-sub broker client.

conn is the client connection returned by gcppubsub.Dial for connecting to GCP pub-sub broker, projectID is the project ID for your GCP project. Additional configuration options can be added with gcppubsub.Option functions.

func (*Client) Close

func (client *Client) Close(ctx context.Context) error

Close closes the GRPC connection to GCP PubSub broker

func (*Client) Subscribe

func (client *Client) Subscribe(ctx context.Context, subscription string) (*pubsub.Subscription, error)

Subscribe method subscribes to the GCP PubSub subscription

type Option

type Option func(*Client) error

Option is a self-refrential function for configuration parameters

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL