generate

package
v1.0.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitSlice

func SplitSlice[S []E, E any](s S, iteratee func(item E, index int) bool) (s1 S, s2 S)

SplitSlice splits an input slice into two output slices depending on the iteratee function.

If the function returns true, then the element is placed in the first output slice. If not, the element is placed in the second output slice.

Types

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

Executor represents a craft generation parameters.

Associated to it are functions for generate command. An Executor should always be created with NewExecutor or unexpected behaviors will occur.

func NewExecutor

func NewExecutor(config models.CraftConfig, opts models.GenerateOptions) (*Executor, error)

NewExecutor creates a new executor from given craft configuration and destdir.

func (*Executor) Execute

func (e *Executor) Execute(ctx context.Context) error

Execute initializes all languages found in current directory and execute all templates found in executor srcdir to executor destdir directory.

Jump to

Keyboard shortcuts

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