dirbuild

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package dirbuild interprets a tony build directory

Index

Constants

View Source
const (
	DefaultSuffix = "-ytool" + ".yaml"
)
View Source
const (
	EnvEnv = "TONY_DIRBUILD_ENV"
)

Variables

This section is empty.

Functions

func LoadEnv

func LoadEnv() (map[string]any, error)

Types

type Dir

type Dir struct {
	Root    string              `tony:"omit"`
	Suffix  string              `tony:"field=suffix"`
	DestDir string              `tony:"field=destDir"`
	Sources []DirSource         `tony:"field=sources"`
	Patches []DirPatch          `tony:"field=patches"`
	Env     map[string]*ir.Node `tony:"field=env"`
	// contains filtered or unexported fields
}

func OpenDir

func OpenDir(path string, env map[string]*ir.Node) (*Dir, error)

func (*Dir) FromTony added in v0.0.2

func (s *Dir) FromTony(data []byte, opts ...gomap.UnmapOption) error

FromTony parses Tony format bytes and populates Dir.

func (*Dir) FromTonyIR added in v0.0.6

func (s *Dir) FromTonyIR(node *ir.Node, opts ...gomap.UnmapOption) error

FromTonyIR populates Dir from a Tony IR node.

func (*Dir) LoadProfile

func (d *Dir) LoadProfile(profile string, env map[string]any) error

func (*Dir) Profiles

func (d *Dir) Profiles() ([]string, error)

func (*Dir) Run

func (d *Dir) Run(w io.WriteCloser, opts ...encode.EncodeOption) ([]*ir.Node, error)

func (*Dir) ToTony added in v0.0.2

func (s *Dir) ToTony(opts ...gomap.MapOption) ([]byte, error)

ToTony converts Dir to Tony format bytes.

func (*Dir) ToTonyIR added in v0.0.6

func (s *Dir) ToTonyIR(opts ...gomap.MapOption) (*ir.Node, error)

ToTonyIR converts Dir to a Tony IR node.

type DirPatch

type DirPatch struct {
	Match *ir.Node `tony:"field=match"`
	Patch *ir.Node `tony:"field=patch"`
	File  string   `tony:"field=file"`
	If    string   `tony:"field=if"`
	// contains filtered or unexported fields
}

func (*DirPatch) FromTony added in v0.0.2

func (s *DirPatch) FromTony(data []byte, opts ...gomap.UnmapOption) error

FromTony parses Tony format bytes and populates DirPatch.

func (*DirPatch) FromTonyIR added in v0.0.6

func (s *DirPatch) FromTonyIR(node *ir.Node, opts ...gomap.UnmapOption) error

FromTonyIR populates DirPatch from a Tony IR node.

func (*DirPatch) String

func (d *DirPatch) String() string

func (*DirPatch) ToTony added in v0.0.2

func (s *DirPatch) ToTony(opts ...gomap.MapOption) ([]byte, error)

ToTony converts DirPatch to Tony format bytes.

func (*DirPatch) ToTonyIR added in v0.0.6

func (s *DirPatch) ToTonyIR(opts ...gomap.MapOption) (*ir.Node, error)

ToTonyIR converts DirPatch to a Tony IR node.

type DirSource

type DirSource struct {
	Format *format.Format `tony:"field=format"`
	Exec   *string        `tony:"field=exec"`
	Dir    *string        `tony:"field=dir"`
	URL    *string        `tony:"field=url"`
	// contains filtered or unexported fields
}

DirSource represents a data source for a dirbuild.

func (*DirSource) Fetch

func (s *DirSource) Fetch(root string, env map[string]any) ([]*ir.Node, error)

func (*DirSource) FromTony added in v0.0.2

func (s *DirSource) FromTony(data []byte, opts ...gomap.UnmapOption) error

FromTony parses Tony format bytes and populates DirSource.

func (*DirSource) FromTonyIR added in v0.0.6

func (s *DirSource) FromTonyIR(node *ir.Node, opts ...gomap.UnmapOption) error

FromTonyIR populates DirSource from a Tony IR node.

func (*DirSource) ToTony added in v0.0.2

func (s *DirSource) ToTony(opts ...gomap.MapOption) ([]byte, error)

ToTony converts DirSource to Tony format bytes.

func (*DirSource) ToTonyIR added in v0.0.6

func (s *DirSource) ToTonyIR(opts ...gomap.MapOption) (*ir.Node, error)

ToTonyIR converts DirSource to a Tony IR node.

Jump to

Keyboard shortcuts

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