Documentation ¶
Index ¶
- func NewHTTPPublisher(ctx context.Context, projID, topic string, src oauth2.TokenSource) (pubsub.MultiPublisher, error)
- func NewPublisher(ctx context.Context, projID, topic string, opts ...option.ClientOption) (pubsub.MultiPublisher, error)
- func NewSubscriber(ctx context.Context, projID, subscription string, opts ...option.ClientOption) (pubsub.Subscriber, error)
- type Config
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.
Click to show internal directories.
Click to hide internal directories.