Documentation ¶
Overview ¶
Package bindings provides APIs to transform Kubernetes objects into Camel URIs equivalents
Index ¶
Constants ¶
const ( OrderFirst = 0 OrderStandard = 50 OrderLast = 100 )
Variables ¶
This section is empty.
Functions ¶
func RegisterBindingProvider ¶
func RegisterBindingProvider(bp BindingProvider)
Types ¶
type Binding ¶
type Binding struct { // URI is the Camel URI equivalent URI string // Step is to support complex mapping such as Camel's EIPs Step map[string]interface{} // Traits is a partial trait specification that should be merged into the integration Traits v1.Traits // ApplicationProperties contain properties that should be set on the integration for the binding to work ApplicationProperties map[string]string }
Binding represents how a Kubernetes object is represented in Camel K resources.
func Translate ¶
func Translate(ctx BindingContext, endpointCtx EndpointContext, endpoint v1alpha1.Endpoint) (*Binding, error)
Translate execute all chained binding providers, returning the first success or the first error.
type BindingContext ¶
type BindingContext struct { Ctx context.Context Client client.Client Namespace string Profile v1.TraitProfile }
nolint: containedctx
type BindingProvider ¶
type BindingProvider interface { // ID returns the name of the binding provider ID() string // Translate does the actual mapping Translate(ctx BindingContext, endpointContext EndpointContext, endpoint v1alpha1.Endpoint) (*Binding, error) // Order returns the relative order of execution of the binding provider Order() int }
BindingProvider maps a KameletBinding endpoint into Camel K resources.
type CamelURIBindingProvider ¶
type CamelURIBindingProvider struct{}
CamelURIBindingProvider converts an explicit URI into a Camel endpoint. It's used as fallback if the URI scheme is not known by other providers.
func (CamelURIBindingProvider) ID ¶
func (k CamelURIBindingProvider) ID() string
func (CamelURIBindingProvider) Order ¶
func (k CamelURIBindingProvider) Order() int
func (CamelURIBindingProvider) Translate ¶
func (k CamelURIBindingProvider) Translate(ctx BindingContext, endpointCtx EndpointContext, e v1alpha1.Endpoint) (*Binding, error)
type EndpointContext ¶ added in v1.4.0
type EndpointContext struct { Type v1alpha1.EndpointType Position *int }
func (EndpointContext) GenerateID ¶ added in v1.4.0
func (c EndpointContext) GenerateID() string
type KameletBindingProvider ¶
type KameletBindingProvider struct{}
KameletBindingProvider converts a reference to a Kamelet into a Camel URI.
func (KameletBindingProvider) ID ¶
func (k KameletBindingProvider) ID() string
func (KameletBindingProvider) Order ¶
func (k KameletBindingProvider) Order() int
func (KameletBindingProvider) Translate ¶
func (k KameletBindingProvider) Translate(ctx BindingContext, endpointCtx EndpointContext, e v1alpha1.Endpoint) (*Binding, error)
type KnativeRefBindingProvider ¶
type KnativeRefBindingProvider struct{}
KnativeRefBindingProvider converts a reference to a Kubernetes object into a Camel URI. It's used as fallback if no other providers can decode the object reference.
func (KnativeRefBindingProvider) ID ¶
func (k KnativeRefBindingProvider) ID() string
func (KnativeRefBindingProvider) Order ¶
func (k KnativeRefBindingProvider) Order() int
func (KnativeRefBindingProvider) Translate ¶
func (k KnativeRefBindingProvider) Translate(ctx BindingContext, endpointCtx EndpointContext, e v1alpha1.Endpoint) (*Binding, error)
type KnativeURIBindingProvider ¶
type KnativeURIBindingProvider struct{}
KnativeURIBindingProvider converts a HTTP/HTTPS URI into a Camel Knative endpoint (to call it via CloudEvents).
func (KnativeURIBindingProvider) ID ¶
func (k KnativeURIBindingProvider) ID() string
func (KnativeURIBindingProvider) Order ¶
func (k KnativeURIBindingProvider) Order() int
func (KnativeURIBindingProvider) Translate ¶
func (k KnativeURIBindingProvider) Translate(ctx BindingContext, endpointCtx EndpointContext, e v1alpha1.Endpoint) (*Binding, error)