Documentation ¶
Index ¶
- Constants
- func Destroy()
- func GetServices(projectName string, dir string, transformerSelector *metav1.LabelSelector) (map[string][]plantypes.PlanArtifact, error)
- func Init(assetsPath, sourcePath string, selector labels.Selector, ...) (map[string]string, error)
- func InitTransformers(transformerYamlPaths map[string]string, selector labels.Selector, ...) (map[string]string, error)
- func RegisterTransformer(tf Transformer) error
- func Transform(planArtifacts []plantypes.PlanArtifact, sourceDir, outputPath string) error
- type CNBContainerizer
- func (t *CNBContainerizer) DirectoryDetect(dir string) (services map[string][]transformertypes.Artifact, err error)
- func (t *CNBContainerizer) GetConfig() (transformertypes.Transformer, *environment.Environment)
- func (t *CNBContainerizer) Init(tc transformertypes.Transformer, env *environment.Environment) error
- func (t *CNBContainerizer) Transform(newArtifacts []transformertypes.Artifact, ...) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)
- type CNBContainerizerConfig
- type CloudFoundry
- func (t *CloudFoundry) DirectoryDetect(dir string) (map[string][]transformertypes.Artifact, error)
- func (t *CloudFoundry) GetConfig() (transformertypes.Transformer, *environment.Environment)
- func (t *CloudFoundry) Init(tc transformertypes.Transformer, env *environment.Environment) (err error)
- func (t *CloudFoundry) Transform(newArtifacts []transformertypes.Artifact, ...) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)
- type InvokeDetect
- func (t *InvokeDetect) DirectoryDetect(dir string) (map[string][]transformertypes.Artifact, error)
- func (t *InvokeDetect) GetConfig() (transformertypes.Transformer, *environment.Environment)
- func (t *InvokeDetect) Init(tc transformertypes.Transformer, env *environment.Environment) (err error)
- func (t *InvokeDetect) Transform(inputArtifacts []transformertypes.Artifact, ...) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)
- type ReadMeGenerator
- func (t *ReadMeGenerator) DirectoryDetect(dir string) (services map[string][]transformertypes.Artifact, err error)
- func (t *ReadMeGenerator) GetConfig() (transformertypes.Transformer, *environment.Environment)
- func (t *ReadMeGenerator) Init(tc transformertypes.Transformer, env *environment.Environment) (err error)
- func (t *ReadMeGenerator) Transform(newArtifacts []transformertypes.Artifact, ...) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)
- type Router
- func (t *Router) DirectoryDetect(dir string) (services map[string][]transformertypes.Artifact, err error)
- func (t *Router) GetConfig() (transformertypes.Transformer, *environment.Environment)
- func (t *Router) GetStringFromTemplate(templateString string, artifact transformertypes.Artifact) (filledString string, err error)
- func (t *Router) Init(tc transformertypes.Transformer, env *environment.Environment) (err error)
- func (t *Router) Transform(newArtifacts []transformertypes.Artifact, ...) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)
- type RouterQuestion
- type RouterYamlConfig
- type Transformer
Constants ¶
const ( // ALLOW_ALL_ARTIFACT_TYPES is a wild card that allows a transformer to produce all types of artifacts ALLOW_ALL_ARTIFACT_TYPES = "*" // DEFAULT_SELECTED_LABEL is a label that can be used to remove a transformer from the list of transformers that are selected by default. DEFAULT_SELECTED_LABEL = types.GroupName + "/default-selected" // CONTAINER_BASED_LABEL is a label that indicates that the transformer needs to spawn containers to run. CONTAINER_BASED_LABEL = types.GroupName + "/container-based" )
const (
// LinuxFileSeperator is used to join paths for linux container file system
LinuxFileSeperator = "/"
)
const (
// ResourceRequestKey is the config key for resource requests
ResourceRequestKey = "ResourceRequest"
)
Variables ¶
This section is empty.
Functions ¶
func GetServices ¶
func GetServices(projectName string, dir string, transformerSelector *metav1.LabelSelector) (map[string][]plantypes.PlanArtifact, error)
GetServices returns the list of services detected in a directory
func Init ¶
func Init(assetsPath, sourcePath string, selector labels.Selector, outputPath, projName string) (map[string]string, error)
Init initializes the transformers
func InitTransformers ¶
func InitTransformers(transformerYamlPaths map[string]string, selector labels.Selector, sourcePath, outputPath, projName string, logError, preExistingPlan bool) (map[string]string, error)
InitTransformers initializes a subset of transformers
func RegisterTransformer ¶ added in v0.3.3
func RegisterTransformer(tf Transformer) error
RegisterTransformer allows for adding transformers after initialization
Types ¶
type CNBContainerizer ¶ added in v0.3.3
type CNBContainerizer struct { Config transformertypes.Transformer BuilderImageNameCfg *CNBContainerizerConfig Env *environment.Environment CNBEnv *environment.Environment }
CNBContainerizer implements Containerizer interface
func (*CNBContainerizer) DirectoryDetect ¶ added in v0.3.3
func (t *CNBContainerizer) DirectoryDetect(dir string) (services map[string][]transformertypes.Artifact, err error)
DirectoryDetect runs detect in each sub directory
func (*CNBContainerizer) GetConfig ¶ added in v0.3.3
func (t *CNBContainerizer) GetConfig() (transformertypes.Transformer, *environment.Environment)
GetConfig returns the transformer config
func (*CNBContainerizer) Init ¶ added in v0.3.3
func (t *CNBContainerizer) Init(tc transformertypes.Transformer, env *environment.Environment) error
Init Initializes the transformer
func (*CNBContainerizer) Transform ¶ added in v0.3.3
func (t *CNBContainerizer) Transform(newArtifacts []transformertypes.Artifact, oldArtifacts []transformertypes.Artifact) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)
Transform transforms the artifacts
type CNBContainerizerConfig ¶ added in v0.3.5
type CNBContainerizerConfig struct {
Container environmenttypes.Container
}
CNBContainerizerConfig contains the configuration options for the CNB containerizer transformer.
type CloudFoundry ¶
type CloudFoundry struct { Config transformertypes.Transformer Env *environment.Environment }
CloudFoundry implements Transformer interface
func (*CloudFoundry) DirectoryDetect ¶
func (t *CloudFoundry) DirectoryDetect(dir string) (map[string][]transformertypes.Artifact, error)
DirectoryDetect detects cloud foundry projects in various directories
func (*CloudFoundry) GetConfig ¶
func (t *CloudFoundry) GetConfig() (transformertypes.Transformer, *environment.Environment)
GetConfig returns the transformer config
func (*CloudFoundry) Init ¶
func (t *CloudFoundry) Init(tc transformertypes.Transformer, env *environment.Environment) (err error)
Init Initializes the transformer
func (*CloudFoundry) Transform ¶
func (t *CloudFoundry) Transform(newArtifacts []transformertypes.Artifact, alreadySeenArtifacts []transformertypes.Artifact) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)
Transform transforms the artifacts
type InvokeDetect ¶ added in v0.3.6
type InvokeDetect struct { Config transformertypes.Transformer Env *environment.Environment }
InvokeDetect implements the Transformer interface
func (*InvokeDetect) DirectoryDetect ¶ added in v0.3.6
func (t *InvokeDetect) DirectoryDetect(dir string) (map[string][]transformertypes.Artifact, error)
DirectoryDetect does nothing
func (*InvokeDetect) GetConfig ¶ added in v0.3.6
func (t *InvokeDetect) GetConfig() (transformertypes.Transformer, *environment.Environment)
GetConfig returns the transformer config
func (*InvokeDetect) Init ¶ added in v0.3.6
func (t *InvokeDetect) Init(tc transformertypes.Transformer, env *environment.Environment) (err error)
Init Initializes the transformer
func (*InvokeDetect) Transform ¶ added in v0.3.6
func (t *InvokeDetect) Transform( inputArtifacts []transformertypes.Artifact, inputOldArtifacts []transformertypes.Artifact, ) ( []transformertypes.PathMapping, []transformertypes.Artifact, error, )
Transform transforms the artifacts
type ReadMeGenerator ¶
type ReadMeGenerator struct { Config transformertypes.Transformer Env *environment.Environment }
ReadMeGenerator implements Transformer interface
func (*ReadMeGenerator) DirectoryDetect ¶
func (t *ReadMeGenerator) DirectoryDetect(dir string) (services map[string][]transformertypes.Artifact, err error)
DirectoryDetect executes detect in directories respecting the m2kignore
func (*ReadMeGenerator) GetConfig ¶
func (t *ReadMeGenerator) GetConfig() (transformertypes.Transformer, *environment.Environment)
GetConfig returns the config of the transformer
func (*ReadMeGenerator) Init ¶
func (t *ReadMeGenerator) Init(tc transformertypes.Transformer, env *environment.Environment) (err error)
Init initializes the translator
func (*ReadMeGenerator) Transform ¶
func (t *ReadMeGenerator) Transform(newArtifacts []transformertypes.Artifact, alreadySeenArtifacts []transformertypes.Artifact) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)
Transform transforms the artifacts
type Router ¶
type Router struct { Config transformertypes.Transformer Env *environment.Environment RouterConfig *RouterYamlConfig }
Router implements Transformer interface
func (*Router) DirectoryDetect ¶
func (t *Router) DirectoryDetect(dir string) (services map[string][]transformertypes.Artifact, err error)
DirectoryDetect runs detects if necessary
func (*Router) GetConfig ¶
func (t *Router) GetConfig() (transformertypes.Transformer, *environment.Environment)
GetConfig returns the transformer config
func (*Router) GetStringFromTemplate ¶
func (t *Router) GetStringFromTemplate(templateString string, artifact transformertypes.Artifact) (filledString string, err error)
GetStringFromTemplate Translates question properties from templates to string
func (*Router) Init ¶
func (t *Router) Init(tc transformertypes.Transformer, env *environment.Environment) (err error)
Init Initializes the transformer
func (*Router) Transform ¶
func (t *Router) Transform(newArtifacts []transformertypes.Artifact, alreadySeenArtifacts []transformertypes.Artifact) ([]transformertypes.PathMapping, []transformertypes.Artifact, error)
Transform transforms the artifacts
type RouterQuestion ¶
type RouterQuestion struct { ID string `yaml:"id" json:"id"` Desc string `yaml:"description,omitempty" json:"description,omitempty"` Hints []string `yaml:"hints,omitempty" json:"hints,omitempty"` }
RouterQuestion stores the templated question for Router
type RouterYamlConfig ¶
type RouterYamlConfig struct { TransformerSelector metav1.LabelSelector `yaml:"transformerSelector" json:"transformerSelector"` RouterQuestion RouterQuestion `yaml:"question" json:"question"` }
RouterYamlConfig stores the yaml configuration for Router transformer
type Transformer ¶
type Transformer interface { Init(tc transformertypes.Transformer, env *environment.Environment) (err error) // GetConfig returns the transformer config GetConfig() (transformertypes.Transformer, *environment.Environment) DirectoryDetect(dir string) (services map[string][]transformertypes.Artifact, err error) Transform(newArtifacts []transformertypes.Artifact, alreadySeenArtifacts []transformertypes.Artifact) ([]transformertypes.PathMapping, []transformertypes.Artifact, error) }
Transformer interface defines transformer that transforms files and converts it to ir representation
func GetInitializedTransformers ¶
func GetInitializedTransformers() []Transformer
GetInitializedTransformers returns the list of initialized transformers
func GetInitializedTransformersF ¶
func GetInitializedTransformersF(filters labels.Selector) []Transformer
GetInitializedTransformersF returns the list of initialized transformers after filtering
func GetTransformerByName ¶ added in v0.3.1
func GetTransformerByName(name string) (t Transformer, err error)
GetTransformerByName returns the transformer chosen by name