bindings

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

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

Package bindings provides APIs to transform Kubernetes objects into Camel URIs equivalents

Index

Constants

View Source
const (
	OrderFirst    = 0
	OrderStandard = 50
	OrderLast     = 100
)

Variables

This section is empty.

Functions

func RegisterBindingProvider

func RegisterBindingProvider(bp BindingProvider)

RegisterBindingProvider --.

func V1alpha1RegisterBindingProvider

func V1alpha1RegisterBindingProvider(bp V1alpha1BindingProvider)

V1alpha1RegisterBindingProvider -- Deprecated.

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 v1.Endpoint) (*Binding, error)

Translate execute all chained binding providers, returning the first success or the first error.

func TranslateV1alpha1

func TranslateV1alpha1(ctx V1alpha1BindingContext, endpointCtx V1alpha1EndpointContext, endpoint v1alpha1.Endpoint) (*Binding, error)

TranslateV1alpha1 execute all chained binding providers, returning the first success or the first error. Deprecated.

func (Binding) AsYamlDSL

func (b Binding) AsYamlDSL() map[string]interface{}

AsYamlDSL construct proper Camel Yaml DSL from given binding.

type BindingContext

type BindingContext struct {
	Ctx       context.Context
	Client    client.Client
	Namespace string
	Profile   v1.TraitProfile
	Metadata  map[string]string
}

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) ID

func (k BindingConverter) ID() string

ID --.

func (BindingConverter) Order

func (k BindingConverter) Order() int

Order --.

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) ID

ID --.

func (CamelURIBindingProvider) Order

func (k CamelURIBindingProvider) Order() int

Order --.

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) ID

ID --.

func (KnativeRefBindingProvider) Order

func (k KnativeRefBindingProvider) Order() int

Order --.

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) ID

ID --.

func (KnativeURIBindingProvider) Order

func (k KnativeURIBindingProvider) Order() int

Order --.

func (KnativeURIBindingProvider) Translate

func (k KnativeURIBindingProvider) Translate(ctx BindingContext, endpointCtx EndpointContext, e v1.Endpoint) (*Binding, error)

Translate --.

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 (StrimziBindingProvider) Order added in v2.5.0

func (s StrimziBindingProvider) Order() int

Order --.

func (StrimziBindingProvider) Translate added in v2.5.0

type V1alpha1BindingContext

type V1alpha1BindingContext struct {
	Ctx       context.Context
	Client    client.Client
	Namespace string
	Profile   v1.TraitProfile
	Metadata  map[string]string
}

V1alpha1BindingContext -- Deprecated.

type V1alpha1BindingConverter

type V1alpha1BindingConverter struct{}

V1alpha1BindingConverter converts a reference to a Kamelet into a Camel URI. Deprecated.

func (V1alpha1BindingConverter) DataTypeStep

func (k V1alpha1BindingConverter) DataTypeStep(e v1alpha1.Endpoint, id string, typeSlot v1alpha1.TypeSlot, dataTypeActionKamelet string) (map[string]interface{}, map[string]string)

DataTypeStep -- . Deprecated.

func (V1alpha1BindingConverter) ID

ID -- . Deprecated.

func (V1alpha1BindingConverter) Order

func (k V1alpha1BindingConverter) Order() int

Order -- . Deprecated.

func (V1alpha1BindingConverter) Translate

Translate -- . Deprecated.

type V1alpha1BindingProvider

type V1alpha1BindingProvider interface {
	// ID returns the name of the binding provider
	ID() string
	// Translate does the actual mapping
	Translate(ctx V1alpha1BindingContext, endpointContext V1alpha1EndpointContext, endpoint v1alpha1.Endpoint) (*Binding, error)
	// Order returns the relative order of execution of the binding provider
	Order() int
}

V1alpha1BindingProvider maps a Binding endpoint into Camel K resources. Deprecated.

type V1alpha1CamelURIBindingProvider

type V1alpha1CamelURIBindingProvider struct{}

V1alpha1CamelURIBindingProvider --. Deprecated .

func (V1alpha1CamelURIBindingProvider) ID

ID --. Deprecated .

func (V1alpha1CamelURIBindingProvider) Order

Order -- Deprecated .

func (V1alpha1CamelURIBindingProvider) Translate

Translate --. Deprecated .

type V1alpha1EndpointContext

type V1alpha1EndpointContext struct {
	Type     v1alpha1.EndpointType
	Position *int
}

V1alpha1EndpointContext -- Deprecated.

func (V1alpha1EndpointContext) GenerateID

func (c V1alpha1EndpointContext) GenerateID() string

GenerateID generates an identifier based on the context type and its optional position. Deprecated.

type V1alpha1KnativeRefBindingProvider

type V1alpha1KnativeRefBindingProvider struct{}

V1alpha1KnativeRefBindingProvider 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. Deprecated.

func (V1alpha1KnativeRefBindingProvider) ID

ID --. Deprecated.

func (V1alpha1KnativeRefBindingProvider) Order

Order --. Deprecated.

func (V1alpha1KnativeRefBindingProvider) Translate

Translate --. Deprecated.

type V1alpha1KnativeURIBindingProvider

type V1alpha1KnativeURIBindingProvider struct{}

V1alpha1KnativeURIBindingProvider converts a HTTP/HTTPS URI into a Camel Knative endpoint (to call it via CloudEvents).

func (V1alpha1KnativeURIBindingProvider) ID

ID --. Deprecated.

func (V1alpha1KnativeURIBindingProvider) Order

Order --. Deprecated.

func (V1alpha1KnativeURIBindingProvider) Translate

Translate --. Deprecated.

type V1alpha1StrimziBindingProvider added in v2.5.0

type V1alpha1StrimziBindingProvider struct {
	Client internalclientset.Interface
}

V1alpha1BindingProvider allows to connect to a Kafka topic via Binding. Deprecated.

func (V1alpha1StrimziBindingProvider) ID added in v2.5.0

ID --. Deprecated.

func (V1alpha1StrimziBindingProvider) Order added in v2.5.0

Order --. Deprecated.

func (V1alpha1StrimziBindingProvider) Translate added in v2.5.0

Translate --. Deprecated.

Jump to

Keyboard shortcuts

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