templateconfig

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 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

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