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 ¶
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 console 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
Get returns the template with the given slug, or (Template{}, false) if none. This is the single accessor projects 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
List returns the validated starter-kit catalog (the SAME slice the HTTP GET serves). Exported so other subsystems — e.g. projects'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.