templates

package
v1.786.72 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package templates mounts /v1/templates — the read-only Hanzo starter-kit gallery: deployable app/site scaffolds (source of truth: hanzoai/gallery), vendored so the unified `cloud` binary ships the catalog with no external dependency. This is REFERENCE content, not org data — there is no per-tenant storage; a user forks a template into a project via the deploy flow, not by mutating this catalog. It mirrors the prompts starter catalog exactly (one embedded JSON, validated once, served under /v1).

Surface:

GET /v1/templates          list the starter-kit catalog        -> {data:[Template]}
GET /v1/templates/:slug    one template by slug (404 if absent) -> Template

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(app *zip.App, deps cloud.Deps) error

Mount registers the read-only templates surface. No store, no DataDir — the catalog is embedded reference content.

Types

type Template

type Template struct {
	Slug        string   `json:"slug"`
	Title       string   `json:"title"`
	Category    string   `json:"category"`
	Description string   `json:"description"`
	Framework   string   `json:"framework"`
	Features    []string `json:"features"`
	UseCase     string   `json:"useCase"`
	Tier        *int     `json:"tier,omitempty"`
	Rating      *float64 `json:"rating,omitempty"`
	Source      string   `json:"source"`
	Preview     string   `json:"preview"`
}

Template is one starter kit as the console2 gallery browser consumes it. The `Source`/`Preview` URLs point at the live gallery (gallery.hanzo.ai), the real fork/deploy + screenshot surfaces.

func Get added in v1.786.14

func Get(slug string) (Template, bool)

Get returns the template with the given slug, or (Template{}, false) if none. This is the single accessor projectsvc uses to seed a Project from a template, so the template→project mapping reads the catalog through one door.

func List added in v1.786.14

func List() ([]Template, error)

List returns the validated starter-kit catalog (the SAME slice the HTTP GET serves). Exported so other subsystems — e.g. projectsvc's fork flow — read the ONE embedded catalog instead of vendoring a second copy. Read-only reference content; callers must not mutate the returned slice.

Jump to

Keyboard shortcuts

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