Documentation ¶
Index ¶
- type ExecutionContext
- type ExecutionContextImpl
- type Factory
- type FactoryImpl
- func (instance *FactoryImpl) Must(name string, code string) Template
- func (instance *FactoryImpl) MustFromFile(file string) Template
- func (instance *FactoryImpl) MustFromReader(name string, reader io.Reader) Template
- func (instance *FactoryImpl) New(name string, code string) (Template, error)
- func (instance *FactoryImpl) NewFromFile(file string) (Template, error)
- func (instance *FactoryImpl) NewFromReader(name string, reader io.Reader) (Template, error)
- type Function
- type FunctionProvider
- type Functions
- type Impl
- func (instance *Impl) Execute(data interface{}, target io.Writer) error
- func (instance *Impl) ExecuteToString(data interface{}) (string, error)
- func (instance *Impl) GetSource() string
- func (instance *Impl) GetSourceFile() *string
- func (instance *Impl) GetSourceName() string
- func (instance *Impl) MustExecute(data interface{}, target io.Writer)
- func (instance *Impl) MustExecuteToString(data interface{}) string
- func (instance *Impl) WithSourceFile(sourceFile string) (Template, error)
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecutionContext ¶
type ExecutionContextImpl ¶
func (*ExecutionContextImpl) GetData ¶
func (instance *ExecutionContextImpl) GetData() interface{}
func (*ExecutionContextImpl) GetFactory ¶
func (instance *ExecutionContextImpl) GetFactory() Factory
func (*ExecutionContextImpl) GetTemplate ¶
func (instance *ExecutionContextImpl) GetTemplate() Template
type Factory ¶
type Factory interface { New(name string, code string) (Template, error) NewFromReader(name string, reader io.Reader) (Template, error) NewFromFile(file string) (Template, error) Must(name string, code string) Template MustFromReader(name string, reader io.Reader) Template MustFromFile(file string) Template }
type FactoryImpl ¶
type FactoryImpl struct {
FunctionProvider FunctionProvider
}
func (*FactoryImpl) MustFromFile ¶
func (instance *FactoryImpl) MustFromFile(file string) Template
func (*FactoryImpl) MustFromReader ¶
func (instance *FactoryImpl) MustFromReader(name string, reader io.Reader) Template
func (*FactoryImpl) New ¶
func (instance *FactoryImpl) New(name string, code string) (Template, error)
func (*FactoryImpl) NewFromFile ¶
func (instance *FactoryImpl) NewFromFile(file string) (Template, error)
func (*FactoryImpl) NewFromReader ¶
type Function ¶
type Function interface {
Execute(context ExecutionContext, args ...interface{}) (interface{}, error)
}
type FunctionProvider ¶
type Functions ¶
func (Functions) CreateDummyFuncMap ¶
func (Functions) CreateFuncMap ¶
func (instance Functions) CreateFuncMap(context ExecutionContext) (nt.FuncMap, error)
type Impl ¶
type Impl struct {
// contains filtered or unexported fields
}
func (*Impl) ExecuteToString ¶
func (*Impl) GetSourceFile ¶
func (*Impl) GetSourceName ¶
func (*Impl) MustExecute ¶
func (*Impl) MustExecuteToString ¶
type Template ¶
type Template interface { WithSourceFile(sourceFile string) (Template, error) Execute(data interface{}, target io.Writer) error ExecuteToString(data interface{}) (string, error) MustExecute(data interface{}, target io.Writer) MustExecuteToString(data interface{}) string GetSource() string GetSourceName() string GetSourceFile() *string }
Click to show internal directories.
Click to hide internal directories.