parser

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: MIT Imports: 9 Imported by: 4

README

template-parser

Documentation

Index

Constants

View Source
const ValueNameNA = "N/A"
View Source
const VariableNameResult = "result"

Variables

This section is empty.

Functions

func Parse added in v0.0.2

func Parse(template string, args ...interface{}) (content string, err error)

func ParseGeneral added in v0.0.2

func ParseGeneral(template string, args ...interface{}) (content string, err error)

Types

type Entity

type Entity interface {
	GetType() string
	SetType(string)
	GetName() string
	SetName(string)
}

type GeneralParser

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

func (*GeneralParser) GetPlaceholders

func (p *GeneralParser) GetPlaceholders() (placeholders []string)

func (*GeneralParser) Parse

func (p *GeneralParser) Parse(template string) (err error)

func (*GeneralParser) Render

func (p *GeneralParser) Render(args ...interface{}) (content string, err error)

type Parser

type Parser interface {
	Parse(template string) (err error)
	Render(args ...interface{}) (content string, err error)
}

func NewGeneralParser

func NewGeneralParser() (p Parser, err error)

type Variable

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

func NewVariable

func NewVariable(root interface{}, placeholder string) (v *Variable, err error)

func (*Variable) GetValue

func (v *Variable) GetValue() (value interface{}, err error)

Jump to

Keyboard shortcuts

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