template

package
v0.0.0-...-6caa2fa Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FuncMap = sprig.TxtFuncMap()

	// Options contain the default options for the template execution.
	Options = []string{

		"missingkey=invalid",
	}
)

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// Executes the template on the given target directory path.
	Execute(string) error

	// If used, the template will execute using default values.
	UseDefaultValues()

	// Returns the metadata of the template.
	Info() Metadata
}

Interface is contains the behavior of boilr templates.

func Get

func Get(path string) (Interface, error)

Get retrieves the template from a path.

type JSONTime

type JSONTime time.Time

JSONTime is time.Time with JSON marshaling and unmarshaling implementations.

func NewTime

func NewTime() JSONTime

NewTime returns a new JSONTime containing the current time.

func (*JSONTime) MarshalJSON

func (t *JSONTime) MarshalJSON() ([]byte, error)

MarshalJSON marshals JSONTime to JSON.

func (JSONTime) String

func (t JSONTime) String() string

String returns the string form of JSONTime.

func (*JSONTime) UnmarshalJSON

func (t *JSONTime) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals JSON to JSONTime.

type Metadata

type Metadata struct {
	Tag        string
	Repository string

	Created JSONTime
}

Metadata contains the information for a template.

func (Metadata) String

func (m Metadata) String() []string

String returns the string slice form of Metadata.

Jump to

Keyboard shortcuts

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