scaffold

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Store embed.FS

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	Description  string   `json:"description" yaml:"description"`
	PreScaffold  string   `json:"pre_scaffold" yaml:"pre_scaffold"`
	PostScaffold string   `json:"post_scaffold" yaml:"post_scaffold"`
	Contact      string   `json:"contact" yaml:"contact"`
	Source       string   `json:"source" yaml:"source"`
	Version      string   `json:"version" yaml:"version"`
	Requires     Requires `json:"requires" yaml:"requires"`

	SourceDir string `json:"-" yaml:"-"`
}

func FromDir

func FromDir(dir string) (*Bundle, error)

FromDir reads the bundle from a directory

func FromFile

func FromFile(file string) (*Bundle, error)

FromFile reads a bundle from a file

func FromFs

func FromFs(f fs.FS, dir string) (*Bundle, error)

FromFs reads a bundle from an fs directory, typically via embedding

func FromUrl

func FromUrl(url *url.URL) (*Bundle, error)

FromUrl reads a bundle from a http(s) URL

func (*Bundle) Close

func (b *Bundle) Close() error

Close removes the temporary files holding the bundle

func (*Bundle) Run

func (b *Bundle) Run(dest string, env map[string]any, debug bool) error

Run runs a bundle writing the result to dest

func (*Bundle) Validate

func (b *Bundle) Validate() error

type Requires

type Requires struct {
	// Operator indicates before running the scaffold an operator should be selected
	Operator bool `json:"operator" yaml:"operator"`
}

Requires indicate what data the bundle requires to run successfully

Jump to

Keyboard shortcuts

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