templates

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 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

Overview

Package templates manages reusable Codog artifact and prompt templates.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("template not found")

Functions

This section is empty.

Types

type DiscoveryRoot

type DiscoveryRoot struct {
	Source string `json:"source"`
	Label  string `json:"label"`
	Path   string `json:"path"`
	Exists bool   `json:"exists"`
}

func Sources

func Sources(configHome, workspace string) []DiscoveryRoot

type InstallReport

type InstallReport struct {
	Kind   string `json:"kind"`
	Action string `json:"action"`
	Status string `json:"status"`
	Name   string `json:"name"`
	Source string `json:"source"`
	Path   string `json:"path"`
	Target string `json:"target"`
}

func Install

func Install(source string, targetRoot string, explicitName string, targetLabel string) (InstallReport, error)

type Rendered

type Rendered struct {
	Name       string            `json:"name"`
	Path       string            `json:"path"`
	Source     string            `json:"source"`
	Vars       map[string]string `json:"vars,omitempty"`
	Rendered   string            `json:"rendered"`
	Unresolved []string          `json:"unresolved,omitempty"`
}

func Render

func Render(template Template, vars map[string]string) (Rendered, error)

type SourceNotFoundError

type SourceNotFoundError struct {
	Source string
	Err    error
}

func (SourceNotFoundError) Error

func (e SourceNotFoundError) Error() string

func (SourceNotFoundError) Unwrap

func (e SourceNotFoundError) Unwrap() error

type Template

type Template struct {
	Name           string `json:"name"`
	Path           string `json:"path"`
	Source         string `json:"source"`
	Preview        string `json:"preview"`
	Body           string `json:"body,omitempty"`
	Active         bool   `json:"active"`
	ShadowedBy     string `json:"shadowed_by,omitempty"`
	ShadowedByPath string `json:"shadowed_by_path,omitempty"`
}

func Find

func Find(configHome, workspace, name string) (Template, error)

func Load

func Load(configHome, workspace string) ([]Template, error)

type UninstallReport

type UninstallReport struct {
	Kind    string `json:"kind"`
	Action  string `json:"action"`
	Status  string `json:"status"`
	Name    string `json:"name"`
	Path    string `json:"path"`
	Removed bool   `json:"removed"`
}

func Uninstall

func Uninstall(name string, roots []string) (UninstallReport, error)

Jump to

Keyboard shortcuts

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