tplhelper

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFileExist = errors.New("file exist")

Functions

This section is empty.

Types

type Tpl

type Tpl struct {
	TplDir          string
	TempDir         string
	ReplaceFileName string
	// contains filtered or unexported fields
}

func NewTpl

func NewTpl(tplDir, tempDir, replaceFileName string) Tpl

func (*Tpl) AddFileFuncMap

func (tpl *Tpl) AddFileFuncMap(funcMap template.FuncMap)

func (*Tpl) CreateTpl

func (tpl *Tpl) CreateTpl(data any, autoMoveBasePath, zipFilePath string, replaceIfExist bool) (err error)

zipFilePath: path with file name e.x: "./code.zip"

func (*Tpl) PreviewTpl

func (tpl *Tpl) PreviewTpl(data any) (resultMap map[string]string, err error)

func (*Tpl) SetFileNamePlaceHolder

func (tpl *Tpl) SetFileNamePlaceHolder(fileNamePlaceHolder string)

Jump to

Keyboard shortcuts

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