condition

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition struct {
	Result string // Result store the condition result after a condition run. This variable can't be set by an updatecli configuration
	Config Config // Config defines condition input parameters
	Scm    *scm.ScmHandler
}

Condition defines which condition needs to be met in order to update targets based on the source output

func (*Condition) Run

func (c *Condition) Run(source string) (err error)

Run tests if a specific condition is true

type Conditioner

type Conditioner interface {
	Condition(version string) (bool, error)
	ConditionFromSCM(version string, scm scm.ScmHandler) (bool, error)
}

Conditioner is an interface that test if condition is met

func Unmarshal

func Unmarshal(condition *Condition) (conditioner Conditioner, err error)

Unmarshal decodes a condition struct

type Config

type Config struct {
	DependsOn          []string `yaml:"depends_on"`
	Name               string
	Kind               string
	Prefix             string // Deprecated in favor of Transformers on 2021/01/3
	Postfix            string // Deprecated in favor of Transformers on 2021/01/3
	Transformers       transformer.Transformers
	Spec               interface{}
	Scm                map[string]interface{} // Deprecated field on version [1.17.0]
	SCMID              string                 `yaml:"scmID"` // SCMID references a uniq scm configuration
	SourceID           string                 `yaml:"sourceID"`
	DisableSourceInput bool
}

Config defines conditions input parameters

Jump to

Keyboard shortcuts

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