templateconfig

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const TemplateConfigFile = "template.yaml"

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 the CLI template config file with the default source if the file does not already exist.

func LoadTemplateSources

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

LoadTemplateSources returns template sources from the CLI config file, 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 the CLI template config file.

Types

type Config

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

Config represents the CLI template configuration file (TemplateConfigFile in the config directory).

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