Documentation ¶
Index ¶
Constants ¶
const ( // V02TTLAttribute is the name of the CloudEvents 0.2 extension attribute used to store the // Broker's TTL (number of times a single event can reply through a Broker continuously). V02TTLAttribute = "knativebrokerttl" )
Variables ¶
This section is empty.
Functions ¶
func SendingContext ¶
func SendingContext(ctx context.Context, tctx cehttp.TransportContext, targetURI *url.URL) context.Context
SendingContext creates the context to use when sending a Cloud Event with ceclient.Client. It sets the target and attaches a filtered set of headers from the initial request.
func SetTTL ¶
func SetTTL(ctx cloudevents.EventContext, ttl interface{}) cloudevents.EventContext
SetTTL sets the TTL into the EventContext. ttl should be a positive integer.
Types ¶
type Receiver ¶
type Receiver struct {
// contains filtered or unexported fields
}
Receiver parses Cloud Events, determines if they pass a filter, and sends them to a subscriber.
func New ¶
New creates a new Receiver and its associated MessageReceiver. The caller is responsible for Start()ing the returned MessageReceiver.
func (*Receiver) Start ¶
Start begins to receive messages for the receiver.
Only HTTP POST requests to the root path (/) are accepted. If other paths or methods are needed, use the HandleRequest method directly with another HTTP server.
This method will block until a message is received on the stop channel.