Documentation
¶
Overview ¶
Package templatecatalog reads and validates Galaxio template registries and packs.
Index ¶
- Constants
- func ValidatePack(pack Pack) error
- func ValidateRegistry(registry Registry) error
- func ValidateTemplate(template Template) error
- type Pack
- type PackTemplate
- type Registry
- type RegistryPack
- type SourceFetcher
- func (f SourceFetcher) ListPacks(ctx context.Context, registrySource string) ([]TemplateRef, error)
- func (f SourceFetcher) LoadPack(ctx context.Context, source string) (Pack, error)
- func (f SourceFetcher) LoadRegistry(ctx context.Context, source string) (Registry, error)
- func (f SourceFetcher) LoadTemplate(ctx context.Context, packSource string, templatePath string) (Template, error)
- func (f SourceFetcher) ValidateSource(ctx context.Context, source string) error
- type Template
- type TemplateFile
- type TemplateRef
Constants ¶
const (
DefaultRegistrySource = "github:galax-io/galaxio-template-registry"
)
Variables ¶
This section is empty.
Functions ¶
func ValidatePack ¶
ValidatePack validates pack-level invariants.
func ValidateRegistry ¶
ValidateRegistry validates registry-level invariants.
func ValidateTemplate ¶
ValidateTemplate validates template-level invariants.
Types ¶
type Pack ¶
type Pack struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Name string `yaml:"name"`
Version string `yaml:"version"`
Description string `yaml:"description"`
Templates []PackTemplate `yaml:"templates"`
}
Pack describes templates available in one template pack repository.
type PackTemplate ¶
type PackTemplate struct {
Name string `yaml:"name"`
Path string `yaml:"path"`
Description string `yaml:"description"`
}
PackTemplate points to one template manifest inside a pack.
type Registry ¶
type Registry struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Packs []RegistryPack `yaml:"packs"`
}
Registry is the root index of available template packs.
type RegistryPack ¶
type RegistryPack struct {
Name string `yaml:"name"`
Source string `yaml:"source"`
Description string `yaml:"description"`
}
RegistryPack describes one template pack source.
type SourceFetcher ¶
SourceFetcher loads manifest files from local paths or remote sources.
func (SourceFetcher) ListPacks ¶
func (f SourceFetcher) ListPacks(ctx context.Context, registrySource string) ([]TemplateRef, error)
ListPacks reads the registry and validates referenced packs.
func (SourceFetcher) LoadRegistry ¶
LoadRegistry loads and validates a registry manifest from source.
func (SourceFetcher) LoadTemplate ¶
func (f SourceFetcher) LoadTemplate(ctx context.Context, packSource string, templatePath string) (Template, error)
LoadTemplate loads and validates a template manifest from a pack source.
func (SourceFetcher) ValidateSource ¶
func (f SourceFetcher) ValidateSource(ctx context.Context, source string) error
ValidateSource validates a template pack source and its template manifests.
type Template ¶
type Template struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Name string `yaml:"name"`
DisplayName string `yaml:"displayName"`
Description string `yaml:"description"`
Engine string `yaml:"engine"`
Tags []string `yaml:"tags"`
Inputs map[string]interface{} `yaml:"inputs"`
Computed map[string]string `yaml:"computed"`
Files []TemplateFile `yaml:"files"`
}
Template describes one renderable template.
type TemplateFile ¶
TemplateFile describes one file mapping in a template.