external

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 36 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

type WASM added in v0.3.13

type WASM struct {
	Config     transformertypes.Transformer
	Env        *environment.Environment
	WASMConfig *WASMYamlConfig
}

WASM implements wasm transformer interface and is used for wasm based transformers

func (*WASM) DirectoryDetect added in v0.3.13

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

DirectoryDetect runs detect in each sub directory

func (*WASM) GetConfig added in v0.3.13

GetConfig returns the transformer config

func (*WASM) Init added in v0.3.13

Init Initializes the transformer

func (*WASM) Transform added in v0.3.13

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

Transform transforms the artifacts

type WASMYamlConfig added in v0.3.13

type WASMYamlConfig struct {
	WASMModule string        `yaml:"wasm_module"`
	CompileAOT bool          `yaml:"compile_aot"`
	EnvList    []core.EnvVar `yaml:"env,omitempty"`
}

WASMYamlConfig is the format of wasm transformer yaml config

Jump to

Keyboard shortcuts

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