channel

package
v0.48.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 21 Imported by: 24

Documentation

Index

Constants

View Source
const (
	// K8ServiceNameSuffix is added to the k8 service name which is owned by the channel
	K8ServiceNameSuffix = "-kn-channel"
)
View Source
const (
	ScopeName = "knative.dev/eventing/pkg/channel"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BadRequestError added in v0.38.0

type BadRequestError string

func (BadRequestError) Error added in v0.38.0

func (e BadRequestError) Error() string

type ChannelReference

type ChannelReference struct {
	Namespace string
	Name      string
}

ChannelReference references a Channel within the cluster by name and namespace.

func ParseChannelFromHost added in v0.38.0

func ParseChannelFromHost(host string) (ChannelReference, error)

ParseChannelFromHost determines a Channel reference from a host

func ParseChannelFromPath added in v0.38.0

func ParseChannelFromPath(path string) (ChannelReference, error)

ParseChannelFromPath determines a Channel reference from a URL path

func (*ChannelReference) String

func (r *ChannelReference) String() string

type EventReceiver added in v0.10.0

type EventReceiver struct {
	// contains filtered or unexported fields
}

EventReceiver starts a server to receive new events for the channel dispatcher. The new event is emitted via the receiver function.

func NewEventReceiver added in v0.10.0

func NewEventReceiver(receiverFunc EventReceiverFunc, logger *zap.Logger, opts ...EventReceiverOptions) (*EventReceiver, error)

NewEventReceiver creates an event receiver passing new events to the receiverFunc.

func (*EventReceiver) ServeHTTP added in v0.10.0

func (r *EventReceiver) ServeHTTP(response nethttp.ResponseWriter, request *nethttp.Request)

func (*EventReceiver) Start added in v0.10.0

func (r *EventReceiver) Start(ctx context.Context) error

Start begins to receive events 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.

type EventReceiverFunc added in v0.39.0

type EventReceiverFunc func(context.Context, ChannelReference, event.Event, nethttp.Header) error

EventReceiverFunc is the function to be called for handling the event.

type EventReceiverOptions added in v0.39.0

type EventReceiverOptions func(*EventReceiver) error

ReceiverOptions provides functional options to EventReceiver function.

func MeterProvider added in v0.46.0

func MeterProvider(meterProvider metric.MeterProvider) EventReceiverOptions

func OIDCTokenVerification added in v0.40.0

func OIDCTokenVerification(tokenVerifier *auth.Verifier, audience string) EventReceiverOptions

func ReceiverWithContextFunc added in v0.40.0

func ReceiverWithContextFunc(fn func(context.Context) context.Context) EventReceiverOptions

func ReceiverWithGetPoliciesForFunc added in v0.43.0

func ReceiverWithGetPoliciesForFunc(fn GetPoliciesForFunc) EventReceiverOptions

func ResolveChannelFromHostHeader

func ResolveChannelFromHostHeader(hostToChannelFunc ResolveChannelFromHostFunc) EventReceiverOptions

ResolveChannelFromHostHeader is a ReceiverOption for NewEventReceiver which enables the caller to overwrite the default behaviour defined by ParseChannelFromHost function.

func ResolveChannelFromPath added in v0.39.0

func ResolveChannelFromPath(PathToChannelFunc ResolveChannelFromPathFunc) EventReceiverOptions

ResolveChannelFromPath is a ReceiverOption for NewEventReceiver which enables the caller to overwrite the default behaviour defined by ParseChannelFromPath function.

func TraceProvider added in v0.46.0

func TraceProvider(traceProvider trace.TracerProvider) EventReceiverOptions

type GetPoliciesForFunc added in v0.43.0

type GetPoliciesForFunc func(channel ChannelReference) ([]duckv1.AppliedEventPolicyRef, error)

GetPoliciesForFunc function enables the EventReceiver to get the Channels AppliedEventPoliciesStatus

type ResolveChannelFromHostFunc

type ResolveChannelFromHostFunc func(string) (ChannelReference, error)

ResolveChannelFromHostFunc function enables EventReceiver to get the Channel Reference from incoming request HostHeader before calling receiverFunc. Returns UnknownHostError if the channel is not found, otherwise returns a generic error.

type ResolveChannelFromPathFunc added in v0.38.0

type ResolveChannelFromPathFunc func(string) (ChannelReference, error)

ResolveChannelFromPathFunc function enables EventReceiver to get the Channel Reference from incoming request's path before calling receiverFunc.

type UnknownChannelError added in v0.10.0

type UnknownChannelError struct {
	Channel ChannelReference
}

UnknownChannelError represents the error when an event is received by a channel dispatcher for a channel that does not exist.

func (*UnknownChannelError) Error added in v0.10.0

func (e *UnknownChannelError) Error() string

type UnknownHostError added in v0.14.0

type UnknownHostError string

UnknownHostError represents the error when a ResolveChannelFromHostHeader func cannot resolve an host

func (UnknownHostError) Error added in v0.14.0

func (e UnknownHostError) Error() string

Directories

Path Synopsis
Package fanout provides an http.Handler that takes in one request and fans it out to N other requests, based on a list of Subscriptions.
Package fanout provides an http.Handler that takes in one request and fans it out to N other requests, based on a list of Subscriptions.
Package multichannelfanout provides an http.Handler that takes in one request to a Knative Channel and fans it out to N other requests.
Package multichannelfanout provides an http.Handler that takes in one request to a Knative Channel and fans it out to N other requests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL