templates

package
v0.0.0-...-5da7bf1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

build +ignore templates package comment

build +ignore templates package comment

Index

Constants

This section is empty.

Variables

View Source
var (
	FileSet   *token.FileSet
	Templates map[string]*ast.File
	NameRegex = `(^template_|_template.go$)`
)

Functions

func LoadAll

func LoadAll(fsys fs.FS, regex, dirPath string) (*token.FileSet, map[string]*ast.File, error)

LoadAll returns a map of file names to ast.File pointers. and a token.FileSet which is needed for comment positions.

func Paths

func Paths(fsys fs.FS, regex, dirPath string) (string, []string, error)

Paths returns the absolute dir path and a list of template file names. Template files are .go files that match the regex and do not end with _test.go

Types

type PrimitiveTemplate

type PrimitiveTemplate string

PrimitiveTemplate comment PrimitiveTemplate second line

type StructTemplate

type StructTemplate struct {
	// String comment
	String string `json:"string"`
	// Int comment
	Int int `json:"integer"`
	// Float comment
	Float float64 `json:"float"`
	// Bool comment
	Bool bool `json:"bool"`
	// Struct comment
	Struct *StructTemplate `json:"struct"`
}

StructTemplate comment

Jump to

Keyboard shortcuts

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