Documentation ¶
Index ¶
- func DeleteRemainingHops(_ context.Context, event *event.Event)
- func GetRemainingHops(ctx context.Context, event *event.Event) (int32, bool)
- func SetRemainingHops(ctx context.Context, event *event.Event, hops int32)
- func UpdateRemainingHops(ctx context.Context, event *event.Event, preemptiveHops int32)
- type LabeledEvent
- type SetRemainingHopsTransformer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteRemainingHops ¶ added in v0.15.0
DeleteRemainingHops deletes hops from the event extensions.
func GetRemainingHops ¶ added in v0.15.0
GetRemainingHops returns the remaining hops of the event if it presents. If there is no existing hops value or an invalid one, (0, false) will be returned.
func SetRemainingHops ¶ added in v0.15.0
SetRemainingHops sets the remaining hops in the event. It ignores any existing hops value.
func UpdateRemainingHops ¶ added in v0.15.0
UpdateRemainingHops update an event with proper remaining hops. 1. If the event doesn't have an existing hops value or have an invalid hops value, it puts the preemptive hops in the event. 2. If the event has an existing valid hops value, it decrements it by 1.
Types ¶
type LabeledEvent ¶
type LabeledEvent struct {
// contains filtered or unexported fields
}
LabeledEvent is a wrapper of a cloudevent that allows labeling the event.
func NewLabeledEvent ¶
func NewLabeledEvent(e *cloudevents.Event) *LabeledEvent
NewLabeledEvent creates a new LabeledEvent.
func (*LabeledEvent) Delabeled ¶
func (le *LabeledEvent) Delabeled() *cloudevents.Event
Delabeled returns the cloudevent without labels.
func (*LabeledEvent) Event ¶
func (le *LabeledEvent) Event() *cloudevents.Event
Event returns the LabeledEvent as a cloudevent.
func (*LabeledEvent) GetLabels ¶
func (le *LabeledEvent) GetLabels() map[string]string
GetLabels gets all the labels as a map.
func (*LabeledEvent) WithLabel ¶
func (le *LabeledEvent) WithLabel(key, value string) *LabeledEvent
WithLabel attaches a label to the event as an extension.
type SetRemainingHopsTransformer ¶ added in v0.16.0
type SetRemainingHopsTransformer int32
func (SetRemainingHopsTransformer) Transform ¶ added in v0.16.0
func (h SetRemainingHopsTransformer) Transform(_ binding.MessageMetadataReader, out binding.MessageMetadataWriter) error