Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PublisherSet wire.ProviderSet = wire.NewSet( NewPublisher, clients.NewHTTPMessageReceiver, clients.NewPubsubClient, NewPubSubTopic, wire.Bind(new(HttpMessageReceiver), new(*kncloudevents.HTTPMessageReceiver)), )
PublisherSet provides a handler with a real HTTPMessageReceiver and a PubSub client.
Functions ¶
Types ¶
type HttpMessageReceiver ¶ added in v0.16.0
type HttpMessageReceiver interface {
StartListen(ctx context.Context, handler nethttp.Handler) error
}
HttpMessageReceiver is an interface to listen on http requests.
type PubSubPublisher ¶ added in v0.16.0
PubSubPublisher is an interface to publish events to a pubsub topic.
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
Publisher receives HTTP events and sends them to Pubsub.
func NewPublisher ¶ added in v0.16.0
func NewPublisher(ctx context.Context, inbound HttpMessageReceiver, topic *pubsub.Topic, authType authcheck.AuthType) *Publisher
NewPublisher creates a new publisher.
func (*Publisher) ServeHTTP ¶ added in v0.16.0
func (p *Publisher) ServeHTTP(response nethttp.ResponseWriter, request *nethttp.Request)
ServeHTTP implements net/http Publisher interface method. 1. Performs basic validation of the request. 2. Converts the request to an event. 3. Sends the event to pubsub.
Click to show internal directories.
Click to hide internal directories.