generator

package
v0.0.0-...-5675f61 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(doc *specv31.Document) error

func ValidateRaw

func ValidateRaw(raw interface{}) (interface{}, bool)

Types

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator(defaultTemplates embed.FS, extTemplates *string) *Generator

func (*Generator) GetManifest

func (g *Generator) GetManifest(name string) (*TemplateManifest, error)

func (*Generator) GetTemplate

func (g *Generator) GetTemplate(name string) (*template.Template, error)

func (*Generator) LoadSchema

func (g *Generator) LoadSchema(path string) error

func (*Generator) RenderTemplate

func (g *Generator) RenderTemplate(name string, outPath string, clean bool) error

type RenderTarget

type RenderTarget struct {
	Path     string `json:"path,omitempty"`
	For      string `json:"for,omitempty"`
	Template string `json:"template,omitempty"`
}

type TemplateContext

type TemplateContext struct {
	Doc    *specv31.Document
	Raw    map[string]interface{}
	Node   any
	Config *TemplateManifest
}

type TemplateManifest

type TemplateManifest struct {
	Name        string          `json:"name,omitempty"`
	Description string          `json:"description,omitempty"`
	Render      []*RenderTarget `json:"render,omitempty"`
	Post        *string         `json:"post,omitempty"`
}

Jump to

Keyboard shortcuts

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