Documentation ¶
Index ¶
- Variables
- func CleanupWorkDir(fs afero.Fs, path string)
- func CreateWorkDir(fs afero.Fs) (string, error)
- func Experimental() bool
- func FS(ctx context.Context) afero.Fs
- func HasJsonOrYamlExt(str string) bool
- func HasSuffix(str string, extensions []string) bool
- func IsFile(ctx context.Context, path string) (bool, error)
- func IsJson(data string) bool
- func IsYamlMap(data string) bool
- func RenderFromTemplates(input any, efs embed.FS) ([]byte, error)
- func RenderFromTemplatesWithGlob(input any, main string, glob []string, efs embed.FS) ([]byte, error)
- func RenderFromTemplatesWithMain(input any, main string, efs embed.FS) ([]byte, error)
- func SetColorEnabled(flagNoColor, flagForceColor bool)
- func SetupTemplate(efs embed.FS) (*template.Template, error)
- func SetupTemplateWithGlob(glob []string, efs embed.FS) (*template.Template, error)
- func ToJSON(data []byte) ([]byte, error)
- func WithFS(ctx context.Context, fs afero.Fs) context.Context
- func WriteTempFile(ctx context.Context, data, prefix string) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ColorEnabled bool
Functions ¶
func CleanupWorkDir ¶
CleanupWorkDir removes all files in a directory Eat any errors so we can call it from defer
func CreateWorkDir ¶
CreateWorkDir creates the working directory in tmp and some subdirectories
func Experimental ¶
func Experimental() bool
detect if the EC_EXPERIMENTAL env var is set to enable experimental features
func HasJsonOrYamlExt ¶
func RenderFromTemplates ¶ added in v0.4.54
Here we do the ExecuteTemplate for the caller and return just the output
func RenderFromTemplatesWithGlob ¶ added in v0.4.54
func RenderFromTemplatesWithMain ¶ added in v0.4.54
func SetColorEnabled ¶ added in v0.4.54
func SetColorEnabled(flagNoColor, flagForceColor bool)
func SetupTemplate ¶ added in v0.4.55
Here we assume the caller will do the Execute or ExecuteTemplate themselves
func SetupTemplateWithGlob ¶ added in v0.4.55
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.