Documentation
¶
Overview ¶
Package bindings provides APIs to transform Kubernetes objects into Camel URIs equivalents
Package bindings provides APIs to transform Kubernetes objects into Camel URIs equivalents
Index ¶
- Constants
- func RegisterBindingProvider(bp BindingProvider)
- type Binding
- type BindingContext
- type BindingConverter
- func (k BindingConverter) DataTypeStep(e v1.Endpoint, id string, typeSlot v1.TypeSlot, dataTypeActionKamelet string) (map[string]interface{}, map[string]string)
- func (k BindingConverter) ID() string
- func (k BindingConverter) Order() int
- func (k BindingConverter) Translate(ctx BindingContext, endpointCtx EndpointContext, e v1.Endpoint) (*Binding, error)
- type BindingProvider
- type CamelURIBindingProvider
- type EndpointContext
- type KnativeRefBindingProvider
- type KnativeURIBindingProvider
- type ServiceRefBindingProvider
- type StrimziBindingProvider
Constants ¶
const ( OrderFirst = 0 OrderStandard = 50 OrderLast = 100 )
Variables ¶
This section is empty.
Functions ¶
func RegisterBindingProvider ¶
func RegisterBindingProvider(bp BindingProvider)
RegisterBindingProvider --.
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
// Deprecated: will be removed in future releases
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 v1.Endpoint) (*Binding, error)
Translate execute all chained binding providers, returning the first success or the first error.
type BindingContext ¶
type BindingConverter ¶
type BindingConverter struct{}
BindingConverter converts a reference to a Kamelet into a Camel URI.
func (BindingConverter) DataTypeStep ¶
func (k BindingConverter) DataTypeStep(e v1.Endpoint, id string, typeSlot v1.TypeSlot, dataTypeActionKamelet string) (map[string]interface{}, map[string]string)
DataTypeStep --.
func (BindingConverter) Translate ¶
func (k BindingConverter) Translate(ctx BindingContext, endpointCtx EndpointContext, e v1.Endpoint) (*Binding, error)
Translate --.
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 v1.Endpoint) (*Binding, error)
// Order returns the relative order of execution of the binding provider
Order() int
}
BindingProvider maps a Binding 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) Translate ¶
func (k CamelURIBindingProvider) Translate(ctx BindingContext, endpointCtx EndpointContext, e v1.Endpoint) (*Binding, error)
Translate --.
type EndpointContext ¶
type EndpointContext struct {
Type v1.EndpointType
Position *int
}
func (EndpointContext) GenerateID ¶
func (c EndpointContext) GenerateID() string
GenerateID generates an identifier based on the context type and its optional position.
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) Translate ¶
func (k KnativeRefBindingProvider) Translate(ctx BindingContext, endpointCtx EndpointContext, e v1.Endpoint) (*Binding, error)
Translate --.
type KnativeURIBindingProvider ¶
type KnativeURIBindingProvider struct{}
KnativeURIBindingProvider converts a HTTP/HTTPS URI into a Camel Knative endpoint (to call it via CloudEvents).
func (KnativeURIBindingProvider) Translate ¶
func (k KnativeURIBindingProvider) Translate(ctx BindingContext, endpointCtx EndpointContext, e v1.Endpoint) (*Binding, error)
Translate --.
type ServiceRefBindingProvider ¶ added in v2.7.0
type ServiceRefBindingProvider struct{}
ServiceRefBindingProvider converts a Service into a Camel http endpoint.
func (ServiceRefBindingProvider) ID ¶ added in v2.7.0
func (k ServiceRefBindingProvider) ID() string
ID --.
func (ServiceRefBindingProvider) Order ¶ added in v2.7.0
func (k ServiceRefBindingProvider) Order() int
Order --.
func (ServiceRefBindingProvider) Translate ¶ added in v2.7.0
func (k ServiceRefBindingProvider) Translate(ctx BindingContext, endpointCtx EndpointContext, e v1.Endpoint) (*Binding, error)
Translate will check the endpoint reference being either a Service or an Integration and Pipe which have a Service associated.
type StrimziBindingProvider ¶ added in v2.5.0
type StrimziBindingProvider struct {
Client internalclientset.Interface
}
BindingProvider allows to connect to a Kafka topic via Binding.
func (StrimziBindingProvider) ID ¶ added in v2.5.0
func (s StrimziBindingProvider) ID() string
func (StrimziBindingProvider) Order ¶ added in v2.5.0
func (s StrimziBindingProvider) Order() int
Order --.
func (StrimziBindingProvider) Translate ¶ added in v2.5.0
func (s StrimziBindingProvider) Translate(ctx BindingContext, _ EndpointContext, endpoint camelv1.Endpoint) (*Binding, error)