templates

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsGitURL

func IsGitURL(s string) bool

IsGitURL checks if a string looks like a Git URL

Types

type Fetcher

type Fetcher interface {
	// Fetch retrieves the template and returns a path to the template directory
	Fetch(source string) (string, error)
	// Cleanup removes any temporary files created during fetch
	Cleanup() error
}

Fetcher defines the interface for fetching templates from various sources

type GitFetcher

type GitFetcher struct {
	// contains filtered or unexported fields
}

GitFetcher fetches templates from Git repositories

func NewGitFetcher

func NewGitFetcher() (*GitFetcher, error)

NewGitFetcher creates a new GitFetcher

func (*GitFetcher) Cleanup

func (f *GitFetcher) Cleanup() error

Cleanup removes the temporary directory

func (*GitFetcher) Fetch

func (f *GitFetcher) Fetch(url string) (string, error)

Fetch clones a Git repository and returns the path to the template directory

type LocalFetcher

type LocalFetcher struct {
}

LocalFetcher fetches templates from local filesystem paths

func NewLocalFetcher

func NewLocalFetcher() *LocalFetcher

NewLocalFetcher creates a new LocalFetcher

func (*LocalFetcher) Cleanup

func (f *LocalFetcher) Cleanup() error

Cleanup for LocalFetcher is a no-op since we don't create temporary files

func (*LocalFetcher) Fetch

func (f *LocalFetcher) Fetch(source string) (string, error)

Fetch validates that the local path exists and contains a template directory

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager() *Manager

func (*Manager) GenerateFile

func (m *Manager) GenerateFile(templateName, outputPath string, data TemplateData) error

type Renderer

type Renderer struct {
}

Renderer handles the rendering of templates to a target directory

func NewRenderer

func NewRenderer() *Renderer

NewRenderer creates a new Renderer

func (*Renderer) Render

func (r *Renderer) Render(templateDir, targetDir string, data TemplateData) error

Render walks through the template directory and renders all template files

type TemplateData

type TemplateData struct {
	RepoName         string
	BinaryAlias      string
	BinaryAliasUpper string // Uppercase version for env vars (e.g., CX for cx)
	Description      string
	GoVersion        string
	CoreVersion      string
	TendVersion      string
	ModulePath       string // Full module path (e.g., github.com/grovetools/repo-name)
	IsPublic         bool
}

Jump to

Keyboard shortcuts

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