gcp

package
v0.0.0-...-ef44e86 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPublisher

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

NewPublisher will instantiate a new GCP Publisher.

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