Documentation ¶
Index ¶
- Constants
- Variables
- func NewCloudEvent(data interface{}, typ string) cloudevents.Event
- func NewEventID() string
- func PopulateSpanWithEvent(ctx context.Context, ce cloudevents.Event, spanName string) (context.Context, *trace.Span)
- func RegisterEventSenderWithContext(es EventSenderWithContext)
- func ResetEventSenders()
- func SendEvent(ctx context.Context, ce cloudevents.Event, endpoint interface{}) error
- func Shutdown()
- type EndpointSupporter
- type EventSenderWithContext
- type Sender
Constants ¶
View Source
const (
Name = "wathola-sender"
)
Variables ¶
View Source
var ( // ErrEndpointTypeNotSupported is raised if configured endpoint isn't // supported by any of the event senders that are registered. ErrEndpointTypeNotSupported = errors.New("given endpoint isn't " + "supported by any registered event sender") )
Functions ¶
func NewCloudEvent ¶
func NewCloudEvent(data interface{}, typ string) cloudevents.Event
NewCloudEvent creates a new cloud event
func PopulateSpanWithEvent ¶ added in v0.29.2
func RegisterEventSenderWithContext ¶ added in v0.29.2
func RegisterEventSenderWithContext(es EventSenderWithContext)
RegisterEventSenderWithContext will register EventSenderWithContext to be used.
func ResetEventSenders ¶ added in v0.24.0
func ResetEventSenders()
ResetEventSenders will reset configured event senders to defaults.
Types ¶
type EndpointSupporter ¶ added in v0.29.2
type EndpointSupporter interface { // Supports will check given endpoint definition and decide if it's valid for // this sender. Supports(endpoint interface{}) bool }
type EventSenderWithContext ¶ added in v0.29.2
type EventSenderWithContext interface { EndpointSupporter // SendEventWithContext will send event to the given endpoint and pass context. SendEventWithContext(ctx context.Context, ce cloudevents.Event, endpoint interface{}) error }
EventSenderWithContext will be used to send events to configured endpoint, passing a context.
Click to show internal directories.
Click to hide internal directories.