bindings

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 15 Imported by: 8

Documentation

Overview

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)

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 (CamelURIBindingProvider) Order

func (k CamelURIBindingProvider) Order() int

func (CamelURIBindingProvider) Translate

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 (KameletBindingProvider) Order

func (k KameletBindingProvider) Order() int

func (KameletBindingProvider) Translate

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 (KnativeRefBindingProvider) Order

func (k KnativeRefBindingProvider) Order() int

func (KnativeRefBindingProvider) 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

func (KnativeURIBindingProvider) Order

func (k KnativeURIBindingProvider) Order() int

func (KnativeURIBindingProvider) Translate

Jump to

Keyboard shortcuts

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