templatestore

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

View Source
const Default = "default"

Variables

This section is empty.

Functions

func Read

func Read(name string) ([]byte, error)

Read searches for template `name` in all template directories and returns the contents of the first one found. Template names cannot contain the substring ".." to make sure they don't reference files outside the template directories. We are not using securejoin.SecureJoin because the actual template may be a symlink to a directory elsewhere (e.g. when installed by Homebrew).

Types

type Template

type Template struct {
	Name     string `json:"name"`
	Location string `json:"location"`
}

func Templates

func Templates() ([]Template, error)

Templates returns a list of Template structures containing the Name and Location for each template. It searches all template directories, but only the first template of a given name is recorded. Only non-hidden files with a ".yaml" file extension are considered templates. The final result is sorted alphabetically by template name.

Jump to

Keyboard shortcuts

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