internal

package
v0.1.2-beta.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: ISC Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractVariablesFrom

func ExtractVariablesFrom(in string) []string

func Fields

func Fields(in string) []string

func GetIndentOf

func GetIndentOf(line string) (indent int)

func GetIndentString

func GetIndentString(indent int) string

func GetMostRecentIn

func GetMostRecentIn(dirs ...string) time.Time

func If

func If[T Task | AsyncTask](condition bool, then T) T

func IterateDirsOnly

func IterateDirsOnly(entries []os.DirEntry) func(func(os.DirEntry) bool)

func IterateFilesOnly

func IterateFilesOnly(entries []os.DirEntry) func(func(os.DirEntry) bool)

func LoadTree

func LoadTree(root string, dirs ...[2]string) (map[string]*GenericFile, error)

func PathToResource

func PathToResource(path string) string

func Pipeline

func Pipeline(tasks ...Task) error

Pipeline calls the functions in order and returns the first encountered error

func ResourceToPath

func ResourceToPath(folder_name, resource string) string

func SimpleSubstitute

func SimpleSubstitute(in string, env Env) (string, error)

func SubstituteArray

func SubstituteArray(file *JsonFile, env Env, path string) error

func SubstituteGenericFile

func SubstituteGenericFile(file *GenericFile, env Env) error

func SubstituteJsonFile

func SubstituteJsonFile(file *JsonFile, env Env) error

func SubstituteObject

func SubstituteObject(file *JsonFile, env Env, path string) error

func SubstituteString

func SubstituteString(file *JsonFile, env Env, path string, value gjson.Result) error

func ToAbs

func ToAbs(path string) string

func WriteIndentString

func WriteIndentString(writer io.Writer, indent int)

Types

type AsyncTask

type AsyncTask func(errs *errgroup.Group) error

type Columns

type Columns []string

type Env

type Env struct {
	Iterators map[string]Columns
	Variables map[string]gjson.Result
}

func NewEnv

func NewEnv() Env

type GenericFile

type GenericFile struct {
	Ext  string
	Body []byte
}

func NewGenericFile

func NewGenericFile(ext string, body []byte) *GenericFile

func (*GenericFile) Clone

func (file *GenericFile) Clone() *GenericFile

func (*GenericFile) Formatted

func (file *GenericFile) Formatted() []byte

type JsonFile

type JsonFile struct {
	Body []byte
}

func NewJsonFile

func NewJsonFile(body []byte) *JsonFile

func (*JsonFile) Clone

func (file *JsonFile) Clone() *JsonFile

func (*JsonFile) Delete

func (file *JsonFile) Delete(path string)

func (*JsonFile) ExpectField

func (file *JsonFile) ExpectField(path string, kinds ...gjson.Type) error

func (*JsonFile) Formatted

func (file *JsonFile) Formatted() []byte

func (*JsonFile) Get

func (file *JsonFile) Get(path string) gjson.Result

func (*JsonFile) Set

func (file *JsonFile) Set(path string, value any)

type Rows

type Rows []Columns

type Task

type Task func() error

func Async

func Async(tasks ...AsyncTask) Task

Jump to

Keyboard shortcuts

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