Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // NewEvent returns a new Event, an optional version can be passed to change the // default spec version from 1.0 to the provided version. NewEvent = v2.NewEvent // NewClient creates a new client NewClient = v2.NewClient // NewHTTP creates a new http protocol NewHTTP = v2.NewHTTP // NewHTTPReceiveHandler creates a new HTTP handler NewHTTPReceiveHandler = v2.NewHTTPReceiveHandler // AddFormat adds a new Format. It can be retrieved by Lookup(f.MediaType()) AddFormat = format.Add )
View Source
var ( TextPlain = v2.TextPlain ApplicationXML = v2.ApplicationXML ApplicationJSON = v2.ApplicationJSON ApplicationCloudEventsJSON = v2.ApplicationCloudEventsJSON ApplicationCloudEventsBatchJSON = v2.ApplicationCloudEventsBatchJSON )
View Source
var WithLogger = context.WithLogger
WithLogger returns a new context with the logger injected into the given context.
Functions ¶
This section is empty.
Types ¶
type Event ¶
Event represents the canonical representation of a CloudEvent.
func NewEventWith ¶
NewEventWith creates a new event for the provided args.
type EventArgs ¶
type EventArgs interface {
Type() string
Source() string
Subject() string
DataSchema() string
Extensions() Dictionary
DataContentType() string
}
EventArgs represents the event arguments
type EventArgsAdapter ¶
type EventArgsAdapter struct {
// EventSender sends the actual event
EventSender EventSender
}
EventArgsAdapter represents an event dispatcher
type EventArgsComposer ¶
type EventArgsComposer []EventArgsDispatcher
EventArgsCompoer represents an event dispatcher
type EventArgsConverter ¶
type EventArgsConverter interface {
// inherits from EventArgs
EventArgs
// DataAs converts the event arguments to the given type
DataAs(interface{}) error
}
EventArgsConverter converts an event arguments
type EventArgsDispatcher ¶
type EventArgsDispatcher interface {
// Dispatch dispatches the event args
Dispatch(context.Context, EventArgs) error
}
EventArgsDispatcher dispatches the events
type EventReceiver ¶
EventReceiver represents a receiver
type EventReceiverFunc ¶
EventReceiverFunc represents a receiver func
type EventSender ¶
type EventSender interface {
// Send will transmit the given event over the client's configured transport.
Send(ctx context.Context, event Event) Result
}
EventSender sends cloud events
type NopEventSender ¶
type NopEventSender struct{}
NopEventSender represent no-operation event sender
Source Files
¶
Click to show internal directories.
Click to hide internal directories.