templateconfig

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSources = []templaterepo.RepoSource{
	{
		Owner: "smartcontractkit",
		Repo:  "cre-templates",
		Ref:   "main",
	},
	{
		Owner: "smartcontractkit",
		Repo:  "cre-gcp-prediction-market-demo",
		Ref:   "main",
	},
}

DefaultSources are the default template repositories.

Functions

func EnsureDefaultConfig

func EnsureDefaultConfig(logger *zerolog.Logger) error

EnsureDefaultConfig creates ~/.cre/template.yaml with the default source if the file does not already exist.

func LoadTemplateSources

func LoadTemplateSources(logger *zerolog.Logger) []templaterepo.RepoSource

LoadTemplateSources returns the list of template sources from ~/.cre/template.yaml, falling back to the default source if the file doesn't exist.

func ParseRepoString

func ParseRepoString(s string) (templaterepo.RepoSource, error)

ParseRepoString parses "owner/repo@ref" into a RepoSource.

func SaveTemplateSources

func SaveTemplateSources(sources []templaterepo.RepoSource) error

SaveTemplateSources writes the given sources to ~/.cre/template.yaml.

Types

type Config

type Config struct {
	TemplateRepositories []TemplateRepo `yaml:"templateRepositories"`
}

Config represents the CLI template configuration file at ~/.cre/template.yaml.

type TemplateRepo

type TemplateRepo struct {
	Owner string `yaml:"owner"`
	Repo  string `yaml:"repo"`
	Ref   string `yaml:"ref"`
}

TemplateRepo represents a template repository configuration.

Jump to

Keyboard shortcuts

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