Documentation ¶
Index ¶
- func Exists(path string) bool
- func GetLastModifyTime(path string) (ts int64, err error)
- func IsDir(path string) bool
- func IsFile(path string) bool
- func SaveFile(fileName string, fileContent string) bool
- func WatchConfigFiles(parsers map[string]IConfigParser)
- type IConfigParser
- type NeuteredFileSystem
- type ParserMixIn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLastModifyTime ¶
func WatchConfigFiles ¶
func WatchConfigFiles(parsers map[string]IConfigParser)
周期性监测文件变化,调用Parser的回调
Types ¶
type IConfigParser ¶
type IConfigParser interface { ReloadConfig(path string, init bool) bool //重载配置 GetConfig() interface{} //获取配置 }
解析器需要实现的接口
type NeuteredFileSystem ¶
type NeuteredFileSystem struct {
FileSystem http.FileSystem
}
加强版静态文件服务 如果打开文件夹里面有index.html则返回内容,否则直接返回文件
type ParserMixIn ¶
解析器的默认实现,用于嵌套
func (*ParserMixIn) CheckModify ¶
func (pmi *ParserMixIn) CheckModify(path string) (bool, int64)
CheckModify return if modified and last modify time
func (*ParserMixIn) GetPathModifyTime ¶
func (pmi *ParserMixIn) GetPathModifyTime(path string) int64
GetPathLastModifyTime
func (*ParserMixIn) SetLastModifyTime ¶
func (pmi *ParserMixIn) SetLastModifyTime(path string, ts int64)
SetLastModifyTime update lastModifyTime
Click to show internal directories.
Click to hide internal directories.