component

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 8 Imported by: 5

Documentation

Index

Constants

View Source
const (
	ConfigFilename = ".component.yaml"
)

These paths are relative to the component folder. Use the below functions to get paths relative to the component.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component struct {
	// contains filtered or unexported fields
}

Component represents a component in the mono-repo.

func NewComponent

func NewComponent(config *Config, root string, configFile string, outBaseDir string) Component

func (*Component) Config

func (c *Component) Config() *Config

Config returns the config of the component.

func (*Component) ConfigFile added in v0.38.0

func (c *Component) ConfigFile() string

ConfigFile returns the config file path.

func (*Component) DocsDir

func (c *Component) DocsDir(p ...string) string

DocsDir returns the directory of the components docs folder.

func (*Component) ImagesContainerfile

func (c *Component) ImagesContainerfile(imageType image.Type) string

ImagesContainerfile returns the image file of the component for the image type.

func (*Component) ImagesDir

func (c *Component) ImagesDir(p ...string) string

ImagesDir returns the directory of the components images folder.

func (*Component) Language

func (c *Component) Language() string

Language returns the language of the component.

func (*Component) Name

func (c *Component) Name() string

Name returns the name of the component.

func (*Component) OutBuildBinDir

func (c *Component) OutBuildBinDir(p ...string) string

OutBuildBinDir returns the directory of the components build binary directory.

func (*Component) OutBuildDir

func (c *Component) OutBuildDir(p ...string) string

OutBuildDir returns the directory of the components build folder.

func (*Component) OutBuildDocsDir

func (c *Component) OutBuildDocsDir(p ...string) string

OutBuildDocsDir returns the directory of the components build docs directory.

func (*Component) OutBuildShareDir added in v0.18.0

func (c *Component) OutBuildShareDir(p ...string) string

OutBuildShareDir returns the directory of the components build share directory.

func (*Component) OutCoverageBinDir

func (c *Component) OutCoverageBinDir(p ...string) string

OutCoverageBinDir returns the directory of the coverage binary output directory.

func (*Component) OutCoverageDataDir

func (c *Component) OutCoverageDataDir(p ...string) string

OutCoverageDataDir returns the directory of the coverage data output directory.

func (*Component) OutCoverageDir added in v0.38.0

func (c *Component) OutCoverageDir(p ...string) string

OutCoverageDir returns the directory of the coverage output directory.

func (*Component) OutDir

func (c *Component) OutDir(p ...string) string

OutDir returns the output directory of the component.

func (*Component) OutEnvVariables added in v0.38.0

func (c *Component) OutEnvVariables() []string

OutEnvVariables returns all env. variables corresponding to top-level output directories.

func (*Component) OutImageDir

func (c *Component) OutImageDir(p ...string) string

OutImageDir returns the directory of the image output directory.

func (*Component) OutPackageDir

func (c *Component) OutPackageDir(p ...string) string

OutPackageDir returns the directory of the package output directory.

func (*Component) RelOutPath

func (c *Component) RelOutPath(p string, ps ...string) string

RelOutPath concats paths relative to the component's out directory.

func (*Component) RelPath

func (c *Component) RelPath(p string, ps ...string) string

RelPath concats paths relative to the component's root directory.

func (*Component) Root

func (c *Component) Root() string

Root returns the root directory of the component.

func (*Component) String

func (c *Component) String() string

String returns a string representation of the component.

func (*Component) Version

func (c *Component) Version() *version.Version

Version returns the language of the component.

type ComponentCreator

type ComponentCreator = func(config *Config, rootDir string, configFile string) (*Component, error)

func NewComponentCreator

func NewComponentCreator(outBaseDir string, transformConfig ConfigAdjuster) ComponentCreator

NewComponentCreator creates a factory method which creates components. It will transform the config if a `transformConfig` function is given.

type Config

type Config struct {
	Name    string  `yaml:"name"    validate:"required"`
	Version Version `yaml:"version"`

	Language string `yaml:"language" validate:"required"`

	Inputs  map[string]*input.Config  `yaml:"inputs"`
	Targets map[string]*target.Config `yaml:"targets"`

	// Additional stuff not parsed by quitsh, but for general purposes
	// such as anchors etc. Needed due to strict parsing.
	DotGeneral any `yaml:".general,omitempty"`
}

func (*Config) Init

func (c *Config) Init() (err error)

Init implements the [config.Initer] interface.

func (*Config) TargetByID

func (c *Config) TargetByID(id target.ID) *target.Config

TargetByID finds the target by the respective name in the config.

func (*Config) TargetByName

func (c *Config) TargetByName(name string) *target.Config

TargetByName finds the target by the respective name in the config.

type ConfigAdjuster

type ConfigAdjuster = func(config *Config) error

type Version

type Version struct {
	version.Version
}

func (*Version) Set

func (v *Version) Set(s string) error

Set implements the [pflag.Value] interface.

func (*Version) String

func (v *Version) String() string

String implements the [pflag.Value] interface.

func (*Version) Type

func (v *Version) Type() string

Type implements the [pflag.Value] interface.

func (*Version) UnmarshalMapstruct added in v0.26.0

func (v *Version) UnmarshalMapstruct(data any) error

UnmarshalMapstruct implements the [config.UnmarshalMapstruct] interface.

func (*Version) UnmarshalText

func (v *Version) UnmarshalText(bytes []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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