process

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auxiliary

type Auxiliary struct {
	Ins model.Instance
	// Type will be used to mark definition label for OAM runtime to get the CRD
	// It's now required for trait and main workload object. Extra workload CR object will not have the type.
	Type string

	// Workload or trait with multiple `outputs` will have a name, if name is empty, than it's the main of this type.
	Name string
}

Auxiliary are objects rendered by definition template. the format for auxiliary resource is always: `outputs.<resourceName>`, it can be auxiliary workload or trait

type AuxiliaryHook

type AuxiliaryHook interface {
	Exec(Context, []Auxiliary) error
}

AuxiliaryHook defines function to be invoked before appending auxiliaries to a process.Context

type AuxiliaryHookFn

type AuxiliaryHookFn func(Context, []Auxiliary) error

AuxiliaryHookFn implements AuxiliaryHook interface

func (AuxiliaryHookFn) Exec

func (fn AuxiliaryHookFn) Exec(ctx Context, auxs []Auxiliary) error

Exec will be invoked before appending 'auxs' into ctx.Auxiliaries

type BaseHook

type BaseHook interface {
	Exec(Context, model.Instance) error
}

BaseHook defines function to be invoked before setting base to a process.Context

type BaseHookFn

type BaseHookFn func(Context, model.Instance) error

BaseHookFn implements BaseHook interface

func (BaseHookFn) Exec

func (fn BaseHookFn) Exec(ctx Context, base model.Instance) error

Exec will be invoked before settiing 'base' into ctx.Base

type Context

type Context interface {
	SetBase(base model.Instance) error
	AppendAuxiliaries(auxiliaries ...Auxiliary) error
	Output() (model.Instance, []Auxiliary)
	BaseContextFile() string
	ExtendedContextFile() string
	BaseContextLabels() map[string]string
	SetParameters(params map[string]interface{})
	PushData(key string, data interface{})
	GetCtx() context.Context
}

Context defines Rendering Context Interface

func NewContext

func NewContext(namespace, name, appName, appRevision string) Context

NewContext create render templateContext

func NewContextWithHooks

func NewContextWithHooks(namespace, name, appName, appRevision string, baseHooks []BaseHook, auxHooks []AuxiliaryHook) Context

NewContextWithHooks create render templateContext with hooks for validation

func NewPolicyContext

func NewPolicyContext(namespace, name, appName, appRevision string, components []common.ApplicationComponent) Context

NewPolicyContext create Application Scope templateContext for Policy

func NewProcessContextWithCtx added in v1.1.1

func NewProcessContextWithCtx(ctx context.Context, namespace, name, appName, appRevision string) Context

NewProcessContextWithCtx create render templateContext with ctx

type RequiredSecrets

type RequiredSecrets struct {
	Namespace   string
	Name        string
	ContextName string
	Data        map[string]interface{}
}

RequiredSecrets is used to store all secret names which are generated by cloud resource components and required by current component

Jump to

Keyboard shortcuts

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