Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AdapterSet wire.ProviderSet = wire.NewSet( NewAdapter, clients.NewPubsubClient, NewPubSubSubscription, converters.NewPubSubConverter, NewStatsReporter, clients.NewHTTPClient, )
AdapterSet provides an adapter with a PubSub client and HTTP client.
Functions ¶
func NewPubSubSubscription ¶ added in v0.16.0
func NewPubSubSubscription(ctx context.Context, client *pubsub.Client, subscriptionID SubscriptionID) *pubsub.Subscription
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements the Pub/Sub adapter to deliver Pub/Sub messages from a pre-existing topic/subscription to a Sink.
func NewAdapter ¶ added in v0.16.0
func NewAdapter( ctx context.Context, projectID clients.ProjectID, namespace Namespace, name Name, resourceGroup ResourceGroup, subscription *pubsub.Subscription, outbound *nethttp.Client, converter converters.Converter, reporter StatsReporter, args *AdapterArgs) *Adapter
NewAdapter creates a new adapter.
type AdapterArgs ¶ added in v0.16.0
type AdapterArgs struct { // TopicID is the id of the Pub/Sub topic. TopicID string // SinkURI is the URI where to sink events to. SinkURI string // TransformerURI is the URI for the transformer. // Used for channels. TransformerURI string // Extensions is the converted ExtensionsBased64 value. Extensions map[string]string // ConverterType use to select which converter to use. ConverterType converters.ConverterType }
AdapterArgs has a bundle of arguments needed to create an Adapter.
type Name ¶ added in v0.16.0
type Name string
TODO Name and ResourceGroup might cause problems in the near future, as we might use a single receive-adapter
for multiple source objects. Same with Namespace, when doing multi-tenancy.
type ReportArgs ¶ added in v0.9.0
type ResourceGroup ¶ added in v0.16.0
type ResourceGroup string
type StatsReporter ¶ added in v0.9.0
type StatsReporter interface { // ReportEventCount captures the event count. It records one per call. ReportEventCount(args *ReportArgs, responseCode int) error }
StatsReporter defines the interface for sending metrics.
func NewStatsReporter ¶ added in v0.9.0
func NewStatsReporter(name Name, namespace Namespace, resourceGroup ResourceGroup) (StatsReporter, error)
NewStatsReporter creates a reporter that collects and reports metrics.
type SubscriptionID ¶ added in v0.16.0
type SubscriptionID string
type TransformerURI ¶ added in v0.16.0
type TransformerURI string
Directories ¶
Path | Synopsis |
---|---|
Package converters contains pubsub message to cloudevent converters used by pubsub-based source.
|
Package converters contains pubsub message to cloudevent converters used by pubsub-based source. |
Click to show internal directories.
Click to hide internal directories.