gcp

package
v0.0.0-...-c02d020 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPPublisher

func NewHTTPPublisher(ctx context.Context, projID, topic string, src oauth2.TokenSource) (pubsub.MultiPublisher, error)

NewHTTPPublisher will instantiate a new GCP MultiPublisher that utilizes the HTTP client. This client is useful mainly for the App Engine standard environment as the gRPC client counts against the socket quota for some reason.

func NewPublisher

func NewPublisher(ctx context.Context, projID, topic string, opts ...option.ClientOption) (pubsub.MultiPublisher, error)

NewPublisher will instantiate a new GCP MultiPublisher.

func NewSubscriber

func NewSubscriber(ctx context.Context, projID, subscription string, opts ...option.ClientOption) (pubsub.Subscriber, error)

NewSubscriber will instantiate a new Subscriber that wraps a pubsub.Iterator.

Types

type Config

type Config struct {
	gcp.Config

	// For publishing
	Topic string `envconfig:"GCP_PUBSUB_TOPIC"`
	// For subscribing
	Subscription string `envconfig:"GCP_PUBSUB_SUBSCRIPTION"`
}

Config holds common credentials and config values for working with GCP PubSub.

func LoadConfigFromEnv

func LoadConfigFromEnv() Config

LoadConfigFromEnv will attempt to load a PubSub config from environment variables.

Jump to

Keyboard shortcuts

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