knative

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: Apache-2.0 Imports: 3 Imported by: 7

Documentation

Index

Constants

View Source
const (
	CamelMetaKnativeKind       = "knative.kind"
	CamelMetaKnativeAPIVersion = "knative.apiVersion"
	CamelMetaKnativeReply      = "knative.reply"
	CamelMetaKnativeName       = "knative.name"

	CamelMetaEndpointKind = "camel.endpoint.kind"

	CamelMetaFilterPrefix = "filter."
)

Meta Options

Variables

This section is empty.

Functions

This section is empty.

Types

type CamelEndpointKind

type CamelEndpointKind string

CamelEndpointKind --

const (
	// CamelEndpointKindSource is a service that can be used to consume events
	CamelEndpointKindSource CamelEndpointKind = "source"
	// CamelEndpointKindSink is a service that can be used to send events to
	CamelEndpointKindSink CamelEndpointKind = "sink"
)

type CamelEnvironment

type CamelEnvironment struct {
	Services []CamelServiceDefinition `json:"services"`
}

CamelEnvironment is the top level configuration object expected by the Camel Knative component

func NewCamelEnvironment

func NewCamelEnvironment() CamelEnvironment

NewCamelEnvironment creates a new env

func (*CamelEnvironment) ContainsService

func (env *CamelEnvironment) ContainsService(name string, endpointKind CamelEndpointKind, serviceType CamelServiceType, apiVersion, kind string) bool

ContainsService tells if the environment contains a service with the given name and type

func (*CamelEnvironment) Deserialize

func (env *CamelEnvironment) Deserialize(str string) error

Deserialize deserializes a camel environment into this struct

func (*CamelEnvironment) FindService

func (env *CamelEnvironment) FindService(name string, endpointKind CamelEndpointKind, serviceType CamelServiceType, apiVersion, kind string) *CamelServiceDefinition

FindService --

func (*CamelEnvironment) Serialize

func (env *CamelEnvironment) Serialize() (string, error)

Serialize serializes a CamelEnvironment

type CamelServiceDefinition

type CamelServiceDefinition struct {
	ServiceType CamelServiceType  `json:"type"`
	Name        string            `json:"name"`
	URL         string            `json:"url,omitempty"`
	Path        string            `json:"path,omitempty"`
	Metadata    map[string]string `json:"metadata,omitempty"`
}

CamelServiceDefinition defines the parameters to connect to Knative service. It's also used for exposed services

func BuildCamelServiceDefinition

func BuildCamelServiceDefinition(name string, endpointKind CamelEndpointKind, serviceType CamelServiceType,
	serviceURL url.URL, apiVersion, kind string) (CamelServiceDefinition, error)

BuildCamelServiceDefinition creates a CamelServiceDefinition from a given URL

type CamelServiceType

type CamelServiceType string

CamelServiceType --

const (
	// CamelServiceTypeEndpoint is a callable endpoint
	CamelServiceTypeEndpoint CamelServiceType = "endpoint"
	// CamelServiceTypeChannel is a callable endpoint that will be also associated to a subscription
	CamelServiceTypeChannel CamelServiceType = "channel"
	// CamelServiceTypeEvent is used when the target service is the Knative broker
	CamelServiceTypeEvent CamelServiceType = "event"
)

func (CamelServiceType) ResourceDescription

func (s CamelServiceType) ResourceDescription(subject string) string

Jump to

Keyboard shortcuts

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