Documentation ¶
Index ¶
Constants ¶
View Source
const ( // EventArrivalTime is used to access the metadata stored on a // CloudEvent to measure the time difference between when an events is // received on a broker and before it is dispatched to the trigger function. // The format is an RFC3339 time in string format. For example: 2019-08-26T23:38:17.834384404Z. EventArrivalTime = "knativearrivaltime" // LabelUniqueName is the label for the unique name per stats_reporter instance. LabelUniqueName = "unique_name" // LabelContainerName is the label for the immutable name of the container. LabelContainerName = metrics.LabelContainerName )
View Source
const ( // TTLAttribute is the name of the CloudEvents extension attribute used to store the // Broker's TTL (number of times a single events can reply through a Broker continuously). All // interactions with the attribute should be done through the GetTTL and SetTTL functions. TTLAttribute = "knativebrokerttl" )
Variables ¶
View Source
var ( ContainerTagKey = tag.MustNewKey(LabelContainerName) UniqueTagKey = tag.MustNewKey(LabelUniqueName) )
Functions ¶
func DeleteTTL ¶ added in v0.10.2
func DeleteTTL(ctx cloudevents.EventContext) error
DeleteTTL removes the TTL CE extension attribute
func GetTTL ¶ added in v0.6.1
func GetTTL(ctx cloudevents.EventContext) (int32, error)
GetTTL finds the TTL in the EventContext using a case insensitive comparison for the key. The second return param, is the case preserved key that matched. Depending on the encoding/transport, the extension case could be changed.
func SetTTL ¶
func SetTTL(ctx cloudevents.EventContext, ttl int32) error
SetTTL sets the TTL into the EventContext. ttl should be a positive integer.
func TTLDefaulter ¶ added in v0.12.0
func TTLDefaulter(logger *zap.Logger, defaultTTL int32) client.EventDefaulter
TTLDefaulter returns a cloudevents events defaulter that will manage the TTL for events with the following rules:
If TTL is not found, it will set it to the default passed in. If TTL is <= 0, it will remain 0. If TTL is > 1, it will be reduced by one.
Types ¶
type ErrExtensionInfo ¶ added in v0.36.0
type ErrExtensionInfo struct { ErrDestination *apis.URL `json:"errdestination"` ErrResponseBody []byte `json:"errresponsebody"` }
ErrExtensionInfo struct store the broker-filter's destination and responsebody
Click to show internal directories.
Click to hide internal directories.