platform

package
v0.106.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand(cfg *Config, run func(context.Context, *Platform) error) *cobra.Command

NewCommand returns a new platform command wired to cfg. Flags are not wired to cfg automatically to allow callers to compose behavior as needed. Use cmd.Flags().AddFlagSet(cfg.FlagSet()) to wire them up.

Types

type BuildOpts

type BuildOpts struct {
	PerComponentFunc func(context.Context, int, holos.Component) error
	InfoEnabled      bool
}

BuildOpts represents build options when processing the components in a platform.

type Config

type Config struct {
	// ComponentSelectors select platform components to process.
	ComponentSelectors holos.Selectors
	// TagMap represents cue tags to inject.
	TagMap holos.TagMap
	// Concurrency represents the number of subcommands to execute concurrently.
	Concurrency int
	// WriteTo represents the output base directory for rendered artifacts.
	WriteTo string
	// Stdout represents the standard output pipe.
	Stdout io.Writer
	// Stderr represents the standard error pipe.  Used to copy stderr output from
	// subcommands.
	Stderr io.Writer
}

func NewConfig

func NewConfig() *Config

func (*Config) FlagSet

func (c *Config) FlagSet() *pflag.FlagSet

func (*Config) FlagSetTags

func (c *Config) FlagSetTags() *pflag.FlagSet

type Platform

type Platform struct {
	holos.Platform
	// contains filtered or unexported fields
}

func New

func New(cfg *Config, root, leaf string) *Platform

func (*Platform) Build

func (p *Platform) Build(ctx context.Context, opts BuildOpts) error

Build calls [opts.PerComponentFunc] for each platform component.

func (*Platform) Load

func (p *Platform) Load(ctx context.Context) error

Load discriminates the api version then loads the platform configuration by building a cue instance.

func (*Platform) Root

func (p *Platform) Root() string

Root returns the platform root directory.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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