templates

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 7 Imported by: 0

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