Documentation ¶
Overview ¶
模板文件和路径处理包
Index ¶
- func NewManager(mgr driver.Manager, pa PathAliases) driver.Manager
- type PathAliases
- func (p *PathAliases) Add(alias, absPath string) *PathAliases
- func (p *PathAliases) AddAllSubdir(absPath string) error
- func (p *PathAliases) Aliases() []string
- func (p *PathAliases) Parse(withAliasTagPath string) string
- func (p *PathAliases) ParseOk(withAliasTagPath string) (string, bool)
- func (p *PathAliases) ParsePrefix(withAliasPrefixPath string) string
- func (p *PathAliases) ParsePrefixOk(withAliasPrefixPath string) (string, bool)
- func (p *PathAliases) Range(fn func(string, string) error) (err error)
- func (p *PathAliases) Restore(fullpath string) string
- func (p *PathAliases) RestoreOk(fullpath string) (string, bool)
- func (p *PathAliases) RestorePrefix(fullpath string) string
- func (p *PathAliases) RestorePrefixOk(fullpath string) (string, bool)
- func (p *PathAliases) TmplDirs() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewManager ¶
func NewManager(mgr driver.Manager, pa PathAliases) driver.Manager
NewManager 新建模板文件系统管理驱动实例
Types ¶
type PathAliases ¶
type PathAliases struct {
// contains filtered or unexported fields
}
PathAliases 模板路径别名分组设置
func (*PathAliases) AddAllSubdir ¶
func (p *PathAliases) AddAllSubdir(absPath string) error
AddAllSubdir 添加某个路径下以子文件夹为别名的路径
func (*PathAliases) Parse ¶
func (p *PathAliases) Parse(withAliasTagPath string) string
Parse 根据中括号别名前缀解析模板路径为实际存在的真实路径
func (*PathAliases) ParseOk ¶
func (p *PathAliases) ParseOk(withAliasTagPath string) (string, bool)
ParseOk 根据中括号别名前缀解析模板路径为实际存在的真实路径
func (*PathAliases) ParsePrefix ¶
func (p *PathAliases) ParsePrefix(withAliasPrefixPath string) string
ParsePrefix 根据模板路径子文件夹为别名解析模板路径为实际存在的真实路径
func (*PathAliases) ParsePrefixOk ¶
func (p *PathAliases) ParsePrefixOk(withAliasPrefixPath string) (string, bool)
ParsePrefixOk 根据模板路径子文件夹为别名解析模板路径为实际存在的真实路径
func (*PathAliases) Range ¶
func (p *PathAliases) Range(fn func(string, string) error) (err error)
Range 遍历全部别名及其模板文件夹路径
func (*PathAliases) Restore ¶
func (p *PathAliases) Restore(fullpath string) string
Restore 还原真实路径为带中括号别名前缀的模板初始路径
func (*PathAliases) RestoreOk ¶
func (p *PathAliases) RestoreOk(fullpath string) (string, bool)
RestoreOk 还原真实路径为带中括号别名前缀的模板初始路径
func (*PathAliases) RestorePrefix ¶
func (p *PathAliases) RestorePrefix(fullpath string) string
RestorePrefix 还原真实路径为模板初始路径
func (*PathAliases) RestorePrefixOk ¶
func (p *PathAliases) RestorePrefixOk(fullpath string) (string, bool)
RestorePrefixOk 还原真实路径为模板初始路径
Click to show internal directories.
Click to hide internal directories.