external

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// TemplateConfigType represents the template config type
	TemplateConfigType transformertypes.ConfigType = "TemplateConfig"
)

Variables

View Source
var (
	// DetectContainerOutputDir is the directory where external transformer detect output is stored
	DetectContainerOutputDir = "/var/tmp/m2k_detect_output"
	// TransformContainerOutputDir is the directory where external transformer transform output is stored
	TransformContainerOutputDir = "/var/tmp/m2k_transform_output"
)

Functions

This section is empty.

Types

type Executable

type Executable struct {
	Config     transformertypes.Transformer
	Env        *environment.Environment
	ExecConfig *ExecutableYamlConfig
}

Executable implements transformer interface and is used to write simple external transformers

func (*Executable) DirectoryDetect

func (t *Executable) DirectoryDetect(dir string) (services map[string][]transformertypes.Artifact, err error)

DirectoryDetect runs detect in each sub directory

func (*Executable) GetConfig

GetConfig returns the transformer config

func (*Executable) Init

Init Initializes the transformer

func (*Executable) Transform

func (t *Executable) Transform(newArtifacts []transformertypes.Artifact, alreadySeenArtifacts []transformertypes.Artifact) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)

Transform transforms the artifacts

type ExecutableYamlConfig

type ExecutableYamlConfig struct {
	EnableQA           bool                       `yaml:"enableQA"`
	Platforms          []string                   `yaml:"platforms"`
	EnvList            []core.EnvVar              `yaml:"env,omitempty"`
	DirectoryDetectCMD environmenttypes.Command   `yaml:"directoryDetectCMD"`
	TransformCMD       environmenttypes.Command   `yaml:"transformCMD"`
	Container          environmenttypes.Container `yaml:"container,omitempty"`
}

ExecutableYamlConfig is the format of executable yaml config

type StarYamlConfig

type StarYamlConfig struct {
	StarFile string `yaml:"starFile"`
}

StarYamlConfig defines yaml config for Starlark transformers

type Starlark

type Starlark struct {
	Config      transformertypes.Transformer
	StarConfig  *StarYamlConfig
	StarThread  *starlark.Thread
	StarGlobals starlark.StringDict
	Env         *environment.Environment
	// contains filtered or unexported fields
}

Starlark implements transformer interface and is used to write simple external transformers

func (*Starlark) DirectoryDetect

func (t *Starlark) DirectoryDetect(dir string) (services map[string][]transformertypes.Artifact, err error)

DirectoryDetect runs detect in each sub directory

func (*Starlark) GetConfig

GetConfig returns the transformer config

func (*Starlark) Init

Init Initializes the transformer

func (*Starlark) Transform

func (t *Starlark) Transform(
	newArtifacts []transformertypes.Artifact,
	alreadySeenArtifacts []transformertypes.Artifact,
) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)

Transform transforms the artifacts

Jump to

Keyboard shortcuts

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