template

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package template provides template configuration and parsing utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name        string     `toml:"name" json:"name"`
	Description string     `toml:"description" json:"description"`
	Version     string     `toml:"version" json:"version"`
	Author      string     `toml:"author" json:"author"`
	Engine      string     `toml:"engine" json:"engine"`
	Variables   []Variable `toml:"variables" json:"variables"`
}

Config represents the template configuration

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig loads template configuration from a file

type Variable

type Variable struct {
	Name     string      `toml:"name" json:"name"`
	Type     string      `toml:"type" json:"type"`
	Prompt   string      `toml:"prompt" json:"prompt"`
	Default  interface{} `toml:"default,omitempty" json:"default,omitempty"`
	Required bool        `toml:"required,omitempty" json:"required,omitempty"`
	Choices  []string    `toml:"choices,omitempty" json:"choices,omitempty"`
}

Variable represents a template variable

Jump to

Keyboard shortcuts

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