types

package
v1.10.0-alpha.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithRuntimeParams

func WithRuntimeParams(parent context.Context, params RuntimeParams) context.Context

WithRuntimeParams returns a copy of parent in which the runtime params value is set

Types

type ComponentApply

type ComponentApply func(ctx context.Context, comp common.ApplicationComponent, patcher *cue.Value, clusterName string, overrideNamespace string) (*unstructured.Unstructured, []*unstructured.Unstructured, bool, error)

ComponentApply apply oam component.

type ComponentHealthCheck

type ComponentHealthCheck func(ctx context.Context, comp common.ApplicationComponent, patcher *cue.Value, clusterName string, overrideNamespace string) (bool, *unstructured.Unstructured, []*unstructured.Unstructured, error)

ComponentHealthCheck health check oam component.

type ComponentRender

type ComponentRender func(ctx context.Context, comp common.ApplicationComponent, patcher *cue.Value, clusterName string, overrideNamespace string) (*unstructured.Unstructured, []*unstructured.Unstructured, error)

ComponentRender render oam component.

type GenericProviderFn

type GenericProviderFn[T any, U any] func(context.Context, *Params[T]) (*U, error)

GenericProviderFn is the provider function

func (GenericProviderFn[T, U]) Call

func (fn GenericProviderFn[T, U]) Call(ctx context.Context, value cue.Value) (cue.Value, error)

Call marshal value into json and decode into underlying function input parameters, then fill back the returned output value

type NativeProviderFn

type NativeProviderFn func(context.Context, *Params[cue.Value]) (cue.Value, error)

NativeProviderFn is the legacy native provider function

func (NativeProviderFn) Call

func (fn NativeProviderFn) Call(ctx context.Context, value cue.Value) (cue.Value, error)

Call marshal value into json and decode into underlying function input parameters, then fill back the returned output value

type OAMGenericProviderFn

type OAMGenericProviderFn[T any, U any] func(context.Context, *OAMParams[T]) (*U, error)

OAMGenericProviderFn is the legacy oam provider function

func (OAMGenericProviderFn[T, U]) Call

func (fn OAMGenericProviderFn[T, U]) Call(ctx context.Context, value cue.Value) (cue.Value, error)

Call marshal value into json and decode into underlying function input parameters, then fill back the returned output value

type OAMNativeProviderFn

type OAMNativeProviderFn func(context.Context, *OAMParams[cue.Value]) (cue.Value, error)

OAMNativeProviderFn is the legacy oam native provider function

func (OAMNativeProviderFn) Call

func (fn OAMNativeProviderFn) Call(ctx context.Context, value cue.Value) (cue.Value, error)

Call marshal value into json and decode into underlying function input parameters, then fill back the returned output value

type OAMParams

type OAMParams[T any] struct {
	Params T
	RuntimeParams
}

OAMParams is the legacy oam input parameters of a provider.

type Params

type Params[T any] struct {
	Params T `json:"$params"`
	RuntimeParams
}

Params is the input parameters of a provider.

type Returns

type Returns[T any] struct {
	Returns T `json:"$returns"`
}

Returns is the returns of a provider.

type RuntimeParams

type RuntimeParams struct {
	ComponentApply       ComponentApply
	ComponentRender      ComponentRender
	ComponentHealthCheck ComponentHealthCheck
	WorkloadRender       WorkloadRender
	App                  *v1beta1.Application
	AppLabels            map[string]string
	Appfile              *appfile.Appfile
	Action               types.Action
	ConfigFactory        config.Factory
	KubeHandlers         *providertypes.KubeHandlers
	KubeClient           client.Client
	KubeConfig           *rest.Config
	FieldLabel           string
}

RuntimeParams is the params for runtime

func RuntimeParamsFrom

func RuntimeParamsFrom(ctx context.Context) RuntimeParams

RuntimeParamsFrom returns the runtime params value stored in ctx, if any.

type WorkloadRender

type WorkloadRender func(ctx context.Context, comp common.ApplicationComponent) (*appfile.Component, error)

WorkloadRender render application component into workload

Jump to

Keyboard shortcuts

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