示例#1
0
func registerSourceDirectory(manager *filegen.Manager, baseDir string,
	myPathName string) error {
	file, err := os.Open(path.Join(baseDir, myPathName))
	if err != nil {
		return err
	}
	names, err := file.Readdirnames(-1)
	file.Close()
	if err != nil {
		return err
	}
	for _, name := range names {
		filename := path.Join(myPathName, name)
		pathname := path.Join(baseDir, filename)
		fi, err := os.Lstat(pathname)
		if err != nil {
			return err
		}
		if fi.IsDir() {
			if err := registerSourceDirectory(manager, baseDir,
				filename); err != nil {
				return err
			}
		} else if fi.Mode().IsRegular() {
			fmt.Println(filename, pathname)
			manager.RegisterFileForPath(filename, pathname)
		}
	}
	return nil
}
示例#2
0
文件: load.go 项目: keep94/Dominator
func mdbGenerator(manager *filegen.Manager, pathname string,
	params []string) error {
	manager.RegisterMdbGeneratorForPath(pathname)
	return nil
}
示例#3
0
文件: load.go 项目: keep94/Dominator
func staticTemplateFileGenerator(manager *filegen.Manager, pathname string,
	params []string) error {
	return manager.RegisterTemplateFileForPath(pathname, params[0], false)
}
示例#4
0
文件: load.go 项目: keep94/Dominator
func fileGenerator(manager *filegen.Manager, pathname string,
	params []string) error {
	manager.RegisterFileForPath(pathname, params[0])
	return nil
}