v1alpha1

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the routing/v1alpha1 API group.

+k8s:deepcopy-gen=package +groupName=routing.triggermesh.io

Index

Constants

View Source
const (
	// ConditionReady has status True when the router is ready to send events.
	ConditionReady = apis.ConditionReady
	// ConditionSinkProvided has status True when the router has been configured with a sink target.
	ConditionSinkProvided apis.ConditionType = "SinkProvided"
	// ConditionDeployed has status True when the router's adapter is up and running.
	ConditionDeployed apis.ConditionType = "Deployed"
)

Status conditions

View Source
const (
	// ReasonSinkNotFound is set on a SinkProvided condition when a sink does not exist.
	ReasonSinkNotFound = "SinkNotFound"
	// ReasonSinkEmpty is set on a SinkProvided condition when a sink URI is empty.
	ReasonSinkEmpty = "EmptySinkURI"

	// ReasonRBACNotBound is set on a Deployed condition when an adapter's
	// ServiceAccount cannot be bound.
	ReasonRBACNotBound = "RBACNotBound"
	// ReasonUnavailable is set on a Deployed condition when an adapter in unavailable.
	ReasonUnavailable = "AdapterUnavailable"
)

Reasons for status conditions

View Source
const (
	FilterGenericEventType = "io.triggermesh.routing.filter"
)

Supported event types

View Source
const (
	SplitterGenericEventType = "io.triggermesh.routing.splitter"
)

Supported event types

Variables

View Source
var (
	// SchemeBuilder creates a Scheme builder that is used to register types for this custom API.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme registers the types stored in SchemeBuilder.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: routing.GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func EventType

func EventType(service, eventType string) string

EventType returns an event type in a format suitable for usage as a CloudEvent type attribute.

func IsMultiTenant

func IsMultiTenant(r Router) bool

IsMultiTenant returns whether the given router type is multi-tenant.

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func NewRouterConditionSet

func NewRouterConditionSet(cts ...apis.ConditionType) apis.ConditionSet

NewRouterConditionSet returns a set of status conditions for routers. Default conditions can be augmented by passing condition types as function arguments.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

func WithRouter

func WithRouter(ctx context.Context, r Router) context.Context

WithRouter returns a copy of the parent context in which the value associated with the router key is the given router.

Types

type CloudEventContext

type CloudEventContext struct {
	Type       string            `json:"type"`
	Source     string            `json:"source"`
	Extensions map[string]string `json:"extensions"`
}

CloudEventContext declares context attributes that will be propagated to resulting events.

func (*CloudEventContext) DeepCopy

func (in *CloudEventContext) DeepCopy() *CloudEventContext

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudEventContext.

func (*CloudEventContext) DeepCopyInto

func (in *CloudEventContext) DeepCopyInto(out *CloudEventContext)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Filter

type Filter struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec holds the desired state of the Filter (from the client).
	// +optional
	Spec FilterSpec `json:"spec,omitempty"`

	// Status communicates the observed state of the Filter (from the controller).
	// +optional
	Status RouterStatus `json:"status,omitempty"`
}

Filter is an addressable object that filters incoming events according to provided Common Language Expression

func (*Filter) AsEventSource

func (f *Filter) AsEventSource() string

AsEventSource implements Router.

func (*Filter) DeepCopy

func (in *Filter) DeepCopy() *Filter

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filter.

func (*Filter) DeepCopyInto

func (in *Filter) DeepCopyInto(out *Filter)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Filter) DeepCopyObject

func (in *Filter) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Filter) GetConditionSet

func (f *Filter) GetConditionSet() apis.ConditionSet

GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface.

func (*Filter) GetEventTypes

func (*Filter) GetEventTypes() []string

GetEventTypes implements Router.

func (*Filter) GetGroupVersionKind

func (*Filter) GetGroupVersionKind() schema.GroupVersionKind

GetGroupVersionKind implements kmeta.OwnerRefable

func (*Filter) GetSink

func (f *Filter) GetSink() *duckv1.Destination

GetSink implements Router.

func (*Filter) GetStatus

func (f *Filter) GetStatus() *duckv1.Status

GetStatus retrieves the status of the resource. Implements the KRShaped interface.

func (*Filter) GetStatusManager

func (f *Filter) GetStatusManager() *RouterStatusManager

GetStatusManager implements Router.

func (*Filter) IsMultiTenant

func (*Filter) IsMultiTenant() bool

IsMultiTenant implements MultiTenant.

func (*Filter) SetDefaults

func (f *Filter) SetDefaults(ctx context.Context)

SetDefaults implements apis.Defaultable

func (*Filter) Validate

func (f *Filter) Validate(ctx context.Context) *apis.FieldError

Validate implements apis.Validatable

type FilterList

type FilterList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []Filter `json:"items"`
}

FilterList is a list of Filter resources

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*FilterList) DeepCopy

func (in *FilterList) DeepCopy() *FilterList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FilterList.

func (*FilterList) DeepCopyInto

func (in *FilterList) DeepCopyInto(out *FilterList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*FilterList) DeepCopyObject

func (in *FilterList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type FilterSpec

type FilterSpec struct {
	Expression string `json:"expression"`

	// Sink is a reference to an object that will resolve to a domain name to use as the sink.
	Sink *duckv1.Destination `json:"sink"`
}

FilterSpec contains CEL expression string and the destination sink

func (*FilterSpec) DeepCopy

func (in *FilterSpec) DeepCopy() *FilterSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FilterSpec.

func (*FilterSpec) DeepCopyInto

func (in *FilterSpec) DeepCopyInto(out *FilterSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*FilterSpec) Validate

func (fs *FilterSpec) Validate(ctx context.Context) *apis.FieldError

Validate implements apis.Validatable

type Router

type Router interface {
	metav1.Object
	runtime.Object
	// OwnerRefable is used to construct a generic reconciler for each
	// router type, and convert router objects to owner references.
	kmeta.OwnerRefable
	// KRShaped is used by generated reconcilers to perform pre and
	// post-reconcile status updates.
	duckv1.KRShaped
	// GetSink returns the router's event sink.
	GetSink() *duckv1.Destination
	// GetStatusManager returns a manager for the router's status.
	GetStatusManager() *RouterStatusManager
	// GetEventTypes returns the event types generated by the router.
	GetEventTypes() []string
	// AsEventSource returns a unique reference to the router suitable for
	// use as a CloudEvent source attribute.
	AsEventSource() string
}

Router is implemented by all Routing types.

func RouterFromContext

func RouterFromContext(ctx context.Context) Router

RouterFromContext returns the router stored in the context.

type RouterStatus

type RouterStatus struct {
	duckv1.SourceStatus  `json:",inline"`
	duckv1.AddressStatus `json:",inline"`
}

RouterStatus defines the observed state of an event source.

func (*RouterStatus) DeepCopy

func (in *RouterStatus) DeepCopy() *RouterStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouterStatus.

func (*RouterStatus) DeepCopyInto

func (in *RouterStatus) DeepCopyInto(out *RouterStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RouterStatusManager

type RouterStatusManager struct {
	apis.ConditionSet
	*RouterStatus
}

RouterStatusManager manages the status of routers.

+k8s:deepcopy-gen=false

func (*RouterStatusManager) MarkNoSink

func (m *RouterStatusManager) MarkNoSink()

MarkNoSink sets the SinkProvided condition to False.

func (*RouterStatusManager) MarkRBACNotBound

func (m *RouterStatusManager) MarkRBACNotBound()

MarkRBACNotBound sets the Deployed condition to False, indicating that the adapter's ServiceAccount couldn't be bound.

func (*RouterStatusManager) MarkSink

func (m *RouterStatusManager) MarkSink(uri *apis.URL)

MarkSink sets the SinkProvided condition to True using the given URI.

func (*RouterStatusManager) PropagateServiceAvailability

func (m *RouterStatusManager) PropagateServiceAvailability(ksvc *servingv1.Service)

PropagateServiceAvailability uses the readiness of the provided Service to determine whether the Deployed condition should be marked as True or False.

func (*RouterStatusManager) SetRoute

func (m *RouterStatusManager) SetRoute(urlPath string)

SetRoute appends the given URL path to the current source's URL.

type Splitter

type Splitter struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec holds the desired state of the Splitter (from the client).
	// +optional
	Spec SplitterSpec `json:"spec,omitempty"`

	// Status communicates the observed state of the Splitter (from the controller).
	// +optional
	Status RouterStatus `json:"status,omitempty"`
}

Splitter is an addressable object that splits incoming events according to provided specification.

func (*Splitter) AsEventSource

func (s *Splitter) AsEventSource() string

AsEventSource implements Router.

func (*Splitter) DeepCopy

func (in *Splitter) DeepCopy() *Splitter

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Splitter.

func (*Splitter) DeepCopyInto

func (in *Splitter) DeepCopyInto(out *Splitter)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Splitter) DeepCopyObject

func (in *Splitter) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Splitter) GetConditionSet

func (s *Splitter) GetConditionSet() apis.ConditionSet

GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface.

func (*Splitter) GetEventTypes

func (*Splitter) GetEventTypes() []string

GetEventTypes implements Router.

func (*Splitter) GetGroupVersionKind

func (*Splitter) GetGroupVersionKind() schema.GroupVersionKind

GetGroupVersionKind implements kmeta.OwnerRefable

func (*Splitter) GetSink

func (s *Splitter) GetSink() *duckv1.Destination

GetSink implements Router.

func (*Splitter) GetStatus

func (s *Splitter) GetStatus() *duckv1.Status

GetStatus retrieves the status of the resource. Implements the KRShaped interface.

func (*Splitter) GetStatusManager

func (s *Splitter) GetStatusManager() *RouterStatusManager

GetStatusManager implements Router.

func (*Splitter) IsMultiTenant

func (*Splitter) IsMultiTenant() bool

IsMultiTenant implements MultiTenant.

func (*Splitter) SetDefaults

func (s *Splitter) SetDefaults(ctx context.Context)

SetDefaults implements apis.Defaultable

func (*Splitter) Validate

func (s *Splitter) Validate(ctx context.Context) *apis.FieldError

Validate implements apis.Validatable

type SplitterList

type SplitterList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []Splitter `json:"items"`
}

SplitterList is a list of Splitter resources.

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*SplitterList) DeepCopy

func (in *SplitterList) DeepCopy() *SplitterList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SplitterList.

func (*SplitterList) DeepCopyInto

func (in *SplitterList) DeepCopyInto(out *SplitterList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SplitterList) DeepCopyObject

func (in *SplitterList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type SplitterSpec

type SplitterSpec struct {
	Path      string              `json:"path"`
	CEContext CloudEventContext   `json:"ceContext"`
	Sink      *duckv1.Destination `json:"sink"`
}

SplitterSpec holds the desired state of the Splitter.

func (*SplitterSpec) DeepCopy

func (in *SplitterSpec) DeepCopy() *SplitterSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SplitterSpec.

func (*SplitterSpec) DeepCopyInto

func (in *SplitterSpec) DeepCopyInto(out *SplitterSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SplitterSpec) Validate

func (ss *SplitterSpec) Validate(ctx context.Context) *apis.FieldError

Validate implements apis.Validatable

type ValueFromField

type ValueFromField struct {

	// Field value.
	// +optional
	Value string `json:"value,omitempty"`
	// Field value from a Kubernetes Secret.
	// +optional
	ValueFromSecret *corev1.SecretKeySelector `json:"valueFromSecret,omitempty"`
}

ValueFromField is a struct field that can have its value either defined explicitly or sourced from another entity.

func (*ValueFromField) DeepCopy

func (in *ValueFromField) DeepCopy() *ValueFromField

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValueFromField.

func (*ValueFromField) DeepCopyInto

func (in *ValueFromField) DeepCopyInto(out *ValueFromField)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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