Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ECache ¶
type ECache struct {
// contains filtered or unexported fields
}
cache is the cache used by default in a new Set.
type OSFileSystemLoader ¶
type OSFileSystemLoader struct {
Views *jet.Set
ECache *ECache
// contains filtered or unexported fields
}
自定义文件系统loader,满足和Mem相同的操作行为 OSFileSystemLoader implements Loader interface using OS file system (os.File).
func NewOSFileSystemLoader ¶
func NewOSFileSystemLoader(dirPath string, views *jet.Set, ecache *ECache) *OSFileSystemLoader
NewOSFileSystemLoader returns an initialized OSFileSystemLoader.
func (*OSFileSystemLoader) Delete ¶
func (l *OSFileSystemLoader) Delete(templatePath string)
func (*OSFileSystemLoader) Exists ¶
func (l *OSFileSystemLoader) Exists(templatePath string) bool
Exists returns true if a file is found under the template path after converting it to a file path using the OS's path seperator and joining it with the loader's directory path.
func (*OSFileSystemLoader) Open ¶
func (l *OSFileSystemLoader) Open(templatePath string) (io.ReadCloser, error)
Open returns the result of `os.Open()` on the file located using the same logic as Exists().
func (*OSFileSystemLoader) Set ¶
func (l *OSFileSystemLoader) Set(templatePath string, contents string)
type TemplateEngine ¶
type TemplateEngine struct {
Views *jet.Set
IsFs *bool
Loader *TemplateLoader
}
模板引擎配置
Click to show internal directories.
Click to hide internal directories.