templates

package
v0.0.0-...-fdf9795 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AllCommonTemplates  *template.Template
	GoCommonTemplates   *template.Template
	GoCobraCliTemplates *template.Template
	GoLambdaTemplates   *template.Template
)

Functions

func EnsureDirExists

func EnsureDirExists(p string) error

func GetIgnoredFiles

func GetIgnoredFiles(configDir string) (files []string, err error)

func HasIgnoreFile

func HasIgnoreFile(configDir string) bool

func PathToTemplate

func PathToTemplate(p string) string

func RenderTemplate

func RenderTemplate(t *template.Template, path string, context any) (string, error)

func RenderTemplates

func RenderTemplates(in RenderMap, context any) (map[string]string, error)

func TemplateToPath

func TemplateToPath(p string) string

func WriteFiles

func WriteFiles(in map[string]string) error

Types

type RenderMap

type RenderMap = map[*template.Template][]string

RenderMap maps a template set to the filenames* that should be written. * - filenames are the end result filenames, not the template names with substitution placeholders.

Jump to

Keyboard shortcuts

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