library

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Types []Type = []Type{OpsFile, Yq} // treat as const
)

Functions

func SplitName

func SplitName(scenarioName string) []string

Types

type InterpolatorParams

type InterpolatorParams struct {
	Vars      map[string]interface{} `yaml:"vars,omitempty"`
	VarFiles  map[string]string      `yaml:"var_files,omitempty"`
	VarsFiles []string               `yaml:"vars_files,omitempty"`
	VarsEnv   []string               `yaml:"vars_env,omitempty"`
	VarsStore string                 `yaml:"vars_store,omitempty"`
	RawArgs   []string               `yaml:"raw_args,omitempty"`
}

func (InterpolatorParams) IsZero

func (i InterpolatorParams) IsZero() bool

func (InterpolatorParams) Merge

type Library

type Library struct {
	Libraries []LibraryRef `yaml:"libraries,omitempty"`
	Type      Type         `yaml:"type,omitempty"`
	Scenarios []Scenario   `yaml:"scenarios,omitempty"`
}

type LibraryLoader

type LibraryLoader interface {
	Load(paths []string) (*LoadedLibrary, error)
}

type LibraryRef

type LibraryRef struct {
	Alias string
	Path  string
}

type LoadedLibrary

type LoadedLibrary struct {
	TopLibraries []*Library
	Libraries    map[string]*Library
}

func (*LoadedLibrary) GetAliasedLibrary

func (l *LoadedLibrary) GetAliasedLibrary(lib *Library, alias string) *Library

func (*LoadedLibrary) GetPath

func (l *LoadedLibrary) GetPath(lib *Library) string

func (*LoadedLibrary) GetScenario

func (l *LoadedLibrary) GetScenario(name string) (*Scenario, *Library)

func (*LoadedLibrary) GetScenarioFromLib

func (l *LoadedLibrary) GetScenarioFromLib(lib *Library, name string) (*Scenario, *Library)

func (*LoadedLibrary) GetScenarioTree

func (l *LoadedLibrary) GetScenarioTree(name string) (*ScenarioNode, error)

type Loader

type Loader struct {
	Yaml yaml.YamlAccess
	File file.FileAccess
}

func (*Loader) Load

func (l *Loader) Load(paths []string) (*LoadedLibrary, error)

type Processor

type Processor struct {
	Type    Type                   `yaml:"type,omitempty"`
	Options map[string]interface{} `yaml:"options,omitempty"`
}

func (Processor) IsZero

func (p Processor) IsZero() bool

type Scenario

type Scenario struct {
	Name               string
	Description        string             `yaml:"description,omitempty"`
	GlobalInterpolator InterpolatorParams `yaml:"global_interpolator,omitempty"`
	Interpolator       InterpolatorParams `yaml:"interpolator,omitempty"`
	Snippets           []Snippet          `yaml:"snippets,omitempty"`
	Scenarios          []ScenarioRef      `yaml:"scenarios,omitempty"`
}

type ScenarioNode

type ScenarioNode struct {
	Name               string
	Description        string             `yaml:"description,omitempty"`
	LibraryPath        string             `yaml:"library_path,omitempty"`
	GlobalInterpolator InterpolatorParams `yaml:"global_interpolator,omitempty"`
	RefInterpolator    InterpolatorParams `yaml:"ref_interpolator,omitempty"`
	Interpolator       InterpolatorParams `yaml:"interpolator,omitempty"`
	Snippets           []Snippet          `yaml:"snippets,omitempty"`
	Dependencies       ScenarioNodes      `yaml:"dependencies,omitempty"`
}

func (*ScenarioNode) GetProcessorTypes

func (s *ScenarioNode) GetProcessorTypes() []Type

type ScenarioNodes

type ScenarioNodes []*ScenarioNode

func (ScenarioNodes) GetProcessorTypes

func (n ScenarioNodes) GetProcessorTypes() []Type

type ScenarioRef

type ScenarioRef struct {
	Name         string
	Interpolator InterpolatorParams `yaml:"interpolator,omitempty"`
}

type Snippet

type Snippet struct {
	Path         string             `yaml:"path,omitempty"`
	Interpolator InterpolatorParams `yaml:"interpolator,omitempty"`
	Processor    Processor          `yaml:"processor,omitempty"`
}

type Type

type Type string
const (
	OpsFile Type = "opsfile"
	Yq      Type = "yq"
)

Jump to

Keyboard shortcuts

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