Documentation ¶
Index ¶
- Constants
- Variables
- type Chain
- type ChainStageFunction
- func DryRun(_ ServiceInfoProvider, act ServiceActionProvider) ChainStageFunction
- func Filler(skipPrintLogs bool) ChainStageFunction
- func Import(_ ServiceInfoProvider, act ServiceActionProvider) ChainStageFunction
- func Persist(_ ServiceInfoProvider, act ServiceActionProvider) ChainStageFunction
- func Provision(prov ServiceInfoProvider, act ServiceActionProvider) ChainStageFunction
- func ServiceIdentifierAndMutator(prov ServiceInfoProvider, act ServiceActionProvider) ChainStageFunction
- func Validator(prov ServiceInfoProvider, act ServiceActionProvider, skipValidation bool) ChainStageFunction
- type ChainStageNextFunction
- type ChainStages
- type CompConfigPair
- type Data
- type ServiceActionProvider
- type ServiceInfoProvider
Constants ¶
const DryRunResponseKey = "dryRunResponse"
const FillerPattern = `\$\(#ref\..+\)`
const ImportPattern = `\$\(#use\s.+\)`
const ProvisionSuffixKey = ".isProvisioned"
const UpdateSuffixKey = ".isUpdate"
Variables ¶
var FillerRegex *regexp.Regexp
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 (*Chain) Add ¶
func (ch *Chain) Add(fn ChainStageFunction) *Chain
Add adds a function to the chain and 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 DryRun ¶ added in v0.6.49
func DryRun(_ ServiceInfoProvider, act ServiceActionProvider) ChainStageFunction
There are two types of errors here: 1. Error while performing the Dry Run (when the DryRun request could not be sent) 2. Errors in Dry Run (when the Dry Run request was performed successfully but there are errors in the Object sent for DryRun) We are not considering #2 as an error. #2 is treated as the Response of the Dry Run. DryRun stage does not terminate the whole chain when an error of type #2 is encountered, it rather stores that information in the `Other` placeholder for future use. This is in contrast with the Validation stage where the Validation errors terminate the chain.
func Filler ¶
func Filler(skipPrintLogs bool) ChainStageFunction
Filler - filler stage processes the pattern to subsitute Pattern
func Import ¶
func Import(_ ServiceInfoProvider, act ServiceActionProvider) ChainStageFunction
func Persist ¶
func Persist(_ ServiceInfoProvider, act ServiceActionProvider) ChainStageFunction
func Provision ¶
func Provision(prov ServiceInfoProvider, act ServiceActionProvider) ChainStageFunction
func ServiceIdentifierAndMutator ¶ added in v0.6.28
func ServiceIdentifierAndMutator(prov ServiceInfoProvider, act ServiceActionProvider) ChainStageFunction
ServiceIdentifier takes in a service identity provider and returns a ChainStageFunction
func Validator ¶
func Validator(prov ServiceInfoProvider, act ServiceActionProvider, skipValidation bool) ChainStageFunction
type ChainStageNextFunction ¶
type ChainStages ¶
type ChainStages []ChainStageNextFunction
ChainStages type represents a slice of ChainStageFunction
type CompConfigPair ¶
type Data ¶
type Data struct { Pattern *core.Pattern PatternSvcWorkloadCapabilities map[string]meshmodel.ComponentDefinition PatternSvcTraitCapabilities map[string][]core.TraitCapability //Deprecated. This will be removed and is currently being used to carry properties // 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) Log(msg string) Provision(CompConfigPair) (string, error) GetRegistry() *meshmodel.RegistryManager Persist(string, core.Service, bool) error DryRun([]v1alpha1.Component) (map[string]map[string]core.DryRunResponse2, error) Mutate(*core.Pattern) //Uses pre-defined policies/configuration to mutate the pattern }