stages

package
v0.6.0-rc.6e Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const FillerPattern = `\$\(#ref\..+\)`
View Source
const ImportPattern = `\$\(#use\s.+\)`
View Source
const ProvisionSuffixKey = ".isProvisioned"
View Source
const UpdateSuffixKey = ".isUpdate"

Variables

View Source
var FillerRegex *regexp.Regexp
View Source
var ImportRegex *regexp.Regexp

Functions

This section is empty.

Types

type Chain

type Chain struct {
	// contains filtered or unexported fields
}

Chain allows to add any number of stages to be added to itself allowing "chaining" all of those functions

func CreateChain

func CreateChain() *Chain

CreateChain returns a pointer to the chain object

func (*Chain) Add

func (ch *Chain) Add(fn ChainStageFunction) *Chain

Add adds a function to the chain and returns a pointer to the Chain object

func (*Chain) Clear

func (ch *Chain) Clear() *Chain

Clear clears the chain and returns a pointer to the chain object

func (*Chain) Process

func (ch *Chain) Process(data *Data) *Chain

Process takes in a plan and starts the chain of the functions

Returns a pointer to the Chain object

type ChainStageFunction

type ChainStageFunction func(data *Data, err error, next ChainStageNextFunction)

ChainStageFunction is the type for function that will be invoked on each stage of the chain

func Filler

func Filler(skipPrintLogs bool) ChainStageFunction

Filler - filler stage processes the pattern to subsitute Pattern

func ServiceIdentifier

ServiceIdentifier takes in a service identity provider and returns a ChainStageFunction

type ChainStageNextFunction

type ChainStageNextFunction func(data *Data, err error)

type ChainStages

type ChainStages []ChainStageNextFunction

ChainStages type represents a slice of ChainStageFunction

type CompConfigPair

type CompConfigPair struct {
	Component     v1alpha1.Component
	Configuration v1alpha1.Configuration
	Hosts         map[string]bool
}

type Data

type Data struct {
	Pattern                        *core.Pattern
	PatternSvcWorkloadCapabilities map[string]core.WorkloadCapability
	PatternSvcTraitCapabilities    map[string][]core.TraitCapability

	// Other is for passing metadata across different stages
	Lock  sync.Mutex
	Other map[string]interface{}
}

Data is the struct that will be passed on each stage

type ServiceActionProvider

type ServiceActionProvider interface {
	Terminate(error)
	Provision(CompConfigPair) (string, error)
	Persist(string, core.Service, bool) error
}

type ServiceInfoProvider

type ServiceInfoProvider interface {
	GetMesheryPatternResource(
		name string,
		namespace string,
		typ string,
		oamType string,
	) (ID *uuid.UUID, err error)
	GetServiceMesh() (name string, version string)
	GetAPIVersionForKind(kind string) string
	IsDelete() bool
}

Jump to

Keyboard shortcuts

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