templates

package
v0.26.4 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseVariable

func ParseVariable(d *map[string]any, value string) string

Types

type Action

type Action struct {
	Data       map[string]any `yaml:"data"`
	ActionName string         `yaml:"action_name"`
}

func ParseTemplateActions

func ParseTemplateActions(tasks []Actions, data map[string]any, mode string) ([]Action, error)

type Actions

type Actions struct {
	Id        string                      `yaml:"id"`
	Condition string                      `yaml:"condition"`
	Todo      []map[string]map[string]any `yaml:"todo"`
}

type Config

type Config struct {
	// Actions
	Type string `yaml:"type,omitempty"`

	// Mode?: By default it's 'all',
	//        Use 'any' to stop after one match
	Mode string `yaml:"mode,omitempty"`

	// Hooks: Which templates one should run
	Hooks map[string][]string `yaml:"hooks,omitempty"`
}

type Info

type Info struct {
	Title       string `yaml:"title,omitempty"`
	Description string `yaml:"description,omitempty"`
	Author      string `yaml:"author,omitempty"`
}

type Template

type Template struct {
	Id     string `yaml:"id"`
	Info   Info   `yaml:"info"`
	Config Config `yaml:"config"`

	// Tasks: List of actions to check
	Tasks []Actions `yaml:"tasks"`
}

func Read

func Read(filePath string) *Template

type Templates

type Templates struct {
	TempalteDir string
	Templates   map[string]*Template
	// contains filtered or unexported fields
}

func (*Templates) Close

func (t *Templates) Close()

func (*Templates) Run

func (t *Templates) Run(data map[string]any, hook string) ([]Action, error)

func (*Templates) Setup

func (t *Templates) Setup()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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