component

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 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, outBaseDir string) Component

func (*Component) Config

func (c *Component) Config() *Config

Config returns the config of the component.

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) OutDir

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

OutDir returns the output directory of the component.

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

Language returns the language of the component.

type ComponentCreator

type ComponentCreator = func(config *Config, rootDir 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" validate:"required"`

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

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

func (*Config) Init

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

Init implements the `Initializable` 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 version.Version

func (*Version) Set

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

Implement the pflag.Value interface.

func (*Version) String

func (cv *Version) String() string

Implement the pflag.Value interface.

func (*Version) Type

func (cv *Version) Type() string

Implement the pflag.Value interface.

func (*Version) UnmarshalMapstruct added in v0.26.0

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

Implement the [config.UnmarshalMapstruct] interface.

func (*Version) UnmarshalText

func (cv *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