cmd

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const SHADOW_DIR = ".hof/shadow/"

Variables

This section is empty.

Functions

func EnrichDatamodelBuilder

func EnrichDatamodelBuilder(R *Runtime) func(R *runtime.Runtime, DM *datamodel.Datamodel) error

func EnrichGeneratorBuilder

func EnrichGeneratorBuilder(R *Runtime) func(R *runtime.Runtime, G *gen.Generator) error

func Info

func Info(args []string, rflags flags.RootPflagpole, gflags flags.GenFlagpole, iflags flags.Gen__InfoFlagpole) error

func InitModule

func InitModule(name string, rootflags flags.RootPflagpole, cmdflags flags.GenFlagpole) error

func List

func List(args []string, rflags flags.RootPflagpole, gflags flags.GenFlagpole) error

func Run

func Run(args []string, rflags flags.RootPflagpole, gflags flags.GenFlagpole) error

Types

type AdhocTemplateConfig

type AdhocTemplateConfig struct {
	// Template filepath
	Filepath string

	// CUE path to input value within global value
	Cuepath string

	// CUE path to schema value within global value
	Schema string

	// Filepath to write results, possibly templated
	Outpath string

	// Is this a repeated template
	Repeated bool

	// Is this a data file? What type?
	DataFormat string
}

parsed version of the --template flag semicolon separated: <filepath>:<?cuepath>@<schema>;[]<?outpath> each extra section is

func ParseTemplateFlag

func ParseTemplateFlag(tf string) (cfg AdhocTemplateConfig, err error)

deconstructs the flag into struct semicolon separated: <filepath>:<?cuepath>@<schema>=<?outpath>

type Runtime

type Runtime struct {
	*runtime.Runtime

	// Setup options
	GenFlags     flags.GenFlagpole
	Diff3FlagSet bool // this is so we can set it to true without and explicit "true"
}

gen.Runtime extends the common runtime.Runtime

func NewGenRuntime

func NewGenRuntime(RT *runtime.Runtime, gflags flags.GenFlagpole) *Runtime

func (*Runtime) CleanupRemainingShadow

func (R *Runtime) CleanupRemainingShadow() (errs []error)

func (*Runtime) Clear

func (R *Runtime) Clear()

func (*Runtime) CreateAdhocGenerator

func (R *Runtime) CreateAdhocGenerator() error

func (*Runtime) Initialize

func (R *Runtime) Initialize() error

func (*Runtime) PrintMergeConflicts

func (R *Runtime) PrintMergeConflicts()

func (*Runtime) PrintStats

func (R *Runtime) PrintStats()

func (*Runtime) Reload

func (R *Runtime) Reload(fast bool) (err error)

Clears and reloads a runtime, rereading inputs and reprocessing everything fast determines if the CUE code is reloaded and evaluated or not (fast will skip CUE).

func (*Runtime) RunGenerator

func (R *Runtime) RunGenerator(G *gen.Generator) (errs []error)

func (*Runtime) RunGenerators

func (R *Runtime) RunGenerators() []error

func (*Runtime) ShadowDir

func (R *Runtime) ShadowDir() string

ShadowDir returns the absolute path to shadow dir for this runtime. It accounts for module root and relative directories.

func (*Runtime) WriteOutput

func (R *Runtime) WriteOutput() []error

Jump to

Keyboard shortcuts

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