parser

package
v0.0.0-...-c69be4e Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrParsingBool       = errors.New("unable to parse bool")
	ErrMalformedTemplate = errors.New("malformed template data")
)

Functions

This section is empty.

Types

type InjectClause

type InjectClause string
const (
	InjectBefore InjectClause = "Before"
	InjectAfter  InjectClause = "After"
)

type ParseActions

type ParseActions string
const (
	ActionCreate ParseActions = "Create"
	ActionAppend ParseActions = "Append"
	ActionInject ParseActions = "Inject"
)

type ParseData

type ParseData struct {
	Action        ParseActions
	InjectClause  InjectClause
	InjectMatcher string
	Meta          map[string]string
}

type TemplateData

type TemplateData struct {
	Name   string
	To     string
	Output []byte
	ParseData
}

type TemplateEngine

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

func New

func New(dirPath string, sharedPath string, fileSuffix string) (TemplateEngine, error)

func (*TemplateEngine) Parse

func (te *TemplateEngine) Parse(data TemplateData) ([]TemplateData, error)

Jump to

Keyboard shortcuts

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