structs

package
v0.0.0-...-e1c5dee Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateNameExec         = "exec"
	StateNameEnv          = "env"
	StateNameCheckCmd     = "checkCmd"
	StateNameCheck        = "checkOutHash"
	StateNameCheckSuccess = "checkOutSuccess"
)
View Source
const (
	DirShape      = "septagon"
	FileShape     = "oval"
	DotFilePrefix = "file:"
)
View Source
const (
	Separator     = "/"
	MainNamespace = ""
	MainName      = ""
	MainFullName  = MainNamespace + "/" + MainName
	PipelineShape = "parallelogram"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	PipelineBlockBase `yaml:",inline"`
	Name              string   `yaml:"-"`
	Description       string   `yaml:"desc,omitempty"`
	Check             []string `yaml:"check,omitempty"`
	Exec              []string `yaml:"exec,omitempty"`
	In                []string `yaml:"in,omitempty"`
	Out               []string `yaml:"out,omitempty"`
	Env               []string `yaml:"env,omitempty"`
	Stdout            bool     `yaml:"stdout,omitempty"`
	Stderr            bool     `yaml:"stderr,omitempty"`
	MayFail           bool     `yaml:"may-fail,omitempty"`
	Idempotent        bool     `yaml:"idempotent,omitempty"`
}

func NewBlockFromMap

func NewBlockFromMap(name string, m map[string]interface{}) *Block

func (Block) Changed

func (b Block) Changed(state stateStorage.State, p *Pipeline) bool

func (Block) GetDepsFull

func (b Block) GetDepsFull() []string

func (Block) GetDepsState

func (b Block) GetDepsState(p *Pipeline) string

func (Block) GetState

func (b Block) GetState() (string, error)

func (*Block) Run

func (b *Block) Run(state stateStorage.State, p *Pipeline, dry bool)

func (Block) Visualize

func (b Block) Visualize(ctx *dot.Graph, p *Pipeline, fileMap *map[string]*File, m *map[string]dot.Node, conf conf.VisualizeConf)

type Checkable

type Checkable interface {
	Changed(state stateStorage.State, p *Pipeline) bool
	GetState() (string, error)
}

type File

type File struct {
	Name     string
	Deps     []*Block
	Analyzed bool
	Size     int64
	Mode     os.FileMode
	ModTime  time.Time
	IsDir    bool
	Exists   bool
	// contains filtered or unexported fields
}

func (*File) Analyze

func (f *File) Analyze()

func (File) Changed

func (f File) Changed(s stateStorage.State, p *Pipeline) bool

func (File) GetDepsFull

func (f File) GetDepsFull() []string

func (File) GetFullName

func (f File) GetFullName() string

func (File) GetState

func (f File) GetState() (string, error)

func (File) Visualize

func (f File) Visualize(ctx *dot.Graph, p *Pipeline, fileMap *map[string]*File, m *map[string]dot.Node, conf conf.VisualizeConf)

type Graphable

type Graphable interface {
	GetDepsFull() []string
	GetFullName() string
}

type IncludeBlock

type IncludeBlock struct {
	Include string
	Type    string
}

type Pipeline

type Pipeline struct {
	*PipelineBlockBase `yaml:",inline"`
	Version            float32                  `yaml:"version"`
	Settings           settings.Settings        `yaml:"settings,omitempty"`
	Pipeline           map[string]PipelineBlock `yaml:"pipeline"`
	BlocksMap          map[string]PipelineBlock `yaml:"-"`
	FilesMap           map[string]*File         `yaml:"-"`
	State              stateStorage.State       `yaml:"-"`
}

func NewPipeline

func NewPipeline(version float32, settings settings.Settings, deps []string) *Pipeline

func (Pipeline) Changed

func (p Pipeline) Changed(state stateStorage.State, pipeline *Pipeline) bool

func (*Pipeline) Enrich

func (p *Pipeline) Enrich()

func (Pipeline) GetDepsFull

func (p Pipeline) GetDepsFull() []string

func (Pipeline) GetGraphable

func (p Pipeline) GetGraphable() map[string]Graphable

func (Pipeline) GetState

func (p Pipeline) GetState() (string, error)

func (Pipeline) List

func (p Pipeline) List() []string

func (Pipeline) Run

func (p Pipeline) Run(state stateStorage.State, pl *Pipeline, dry bool)

func (Pipeline) Stages

func (p Pipeline) Stages() map[string]PipelineBlock

func (Pipeline) Visualize

func (p Pipeline) Visualize(ctx *dot.Graph, pi *Pipeline, fileMap *map[string]*File, m *map[string]dot.Node, conf conf.VisualizeConf)

type PipelineBlock

type PipelineBlock interface {
	Checkable
	Graphable
	Visualizable
	Run(state stateStorage.State, p *Pipeline, dry bool)
	GetParent() *Pipeline
}

type PipelineBlockBase

type PipelineBlockBase struct {
	Deps     []string  `yaml:"deps"`
	Parent   *Pipeline `yaml:"-"`
	FullName string    `yaml:"-"`
	DepsFull []string  `yaml:"-"`
}

func (PipelineBlockBase) GetFullName

func (p PipelineBlockBase) GetFullName() string

func (PipelineBlockBase) GetParent

func (p PipelineBlockBase) GetParent() *Pipeline

type PipelineRaw

type PipelineRaw struct {
	Version  float32                `yaml:"version"`
	Settings settings.Settings      `yaml:"settings,omitempty"`
	Pipeline map[string]interface{} `yaml:"pipeline"`
	Deps     []string               `yaml:"deps"`
}

type Visualizable

type Visualizable interface {
	Visualize(ctx *dot.Graph, p *Pipeline, fileMap *map[string]*File, m *map[string]dot.Node, conf conf.VisualizeConf)
}

Jump to

Keyboard shortcuts

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