templatecatalog

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package templatecatalog reads and validates Galaxio template registries and packs.

Index

Constants

View Source
const (
	DefaultRegistrySource = "github:galax-io/galaxio-template-registry"
)

Variables

This section is empty.

Functions

func ValidatePack

func ValidatePack(pack Pack) error

ValidatePack validates pack-level invariants.

func ValidateRegistry

func ValidateRegistry(registry Registry) error

ValidateRegistry validates registry-level invariants.

func ValidateTemplate

func ValidateTemplate(template Template) error

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

type SourceFetcher struct {
	HTTPClient *http.Client
}

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) LoadPack

func (f SourceFetcher) LoadPack(ctx context.Context, source string) (Pack, error)

LoadPack loads and validates a template pack from source.

func (SourceFetcher) LoadRegistry

func (f SourceFetcher) LoadRegistry(ctx context.Context, source string) (Registry, error)

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

type TemplateFile struct {
	From string `yaml:"from"`
	To   string `yaml:"to"`
}

TemplateFile describes one file mapping in a template.

type TemplateRef

type TemplateRef struct {
	Name        string
	Pack        string
	Source      string
	Description string
	Templates   int
	Placeholder bool
}

TemplateRef is a resolved template available to users.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL