Documentation
¶
Index ¶
- Constants
- Variables
- func EnsureDefaultConfig(logger *zerolog.Logger) error
- func LoadTemplateSources(logger *zerolog.Logger) []templaterepo.RepoSource
- func ParseRepoString(s string) (templaterepo.RepoSource, error)
- func SaveTemplateSources(sources []templaterepo.RepoSource) error
- type Config
- type TemplateRepo
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.