templatestore

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: Apache-2.0 Imports: 11 Imported by: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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