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 ¶
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.
Click to show internal directories.
Click to hide internal directories.