workflow

package
v0.0.0-...-552dcf1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Definition

type Definition struct {
	Name        string
	Source      string
	Description string
	Destination string
	Content     string
	JSON        interface{}
	Status      ValidationResult
}

Definition - definitoin for a workflow defined by a GFlows template

func (*Definition) SetContent

func (definition *Definition) SetContent(workflow string, template *pkg.PathInfo)

type GitHubWorkflow

type GitHubWorkflow struct {
	Path       string
	Definition *Definition
}

type TemplateEngine

type TemplateEngine interface {
	// GetObservableSources - returns a list of all the local files used to generate workflows. Used
	// to get the list of files to watch for changes.
	GetObservableSources() ([]string, error)

	// GetWorkflowDefinitions - returns definitions generated from workflow templates.
	GetWorkflowDefinitions() ([]*Definition, error)

	// ImportWorkflow - imports a workflow, returns the path to the new template.
	ImportWorkflow(workflow *GitHubWorkflow) (string, error)

	// WorkflowGenerator - returns a generator to create default workflow and config files
	WorkflowGenerator(templateVars map[string]string) content.WorkflowGenerator
}

type ValidationResult

type ValidationResult struct {
	Valid         bool
	Errors        []string
	ActualContent string
}

ValidationResult - validate result

type Validator

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

Validator - validates a workflow definition

func NewValidator

func NewValidator(fs *afero.Afero, context *config.GFlowsContext) *Validator

NewValidator - creates a new validator for the given filesystem

func (*Validator) ValidateContent

func (validator *Validator) ValidateContent(definition *Definition) ValidationResult

ValidateContent - validates the content at the destination in the definition is up to date

func (*Validator) ValidateSchema

func (validator *Validator) ValidateSchema(definition *Definition) ValidationResult

ValidateSchema - validates the template for the definition generates a valid workflow

Directories

Path Synopsis
ytt

Jump to

Keyboard shortcuts

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