Documentation ¶
Overview ¶
Package replacer 是一个用于替换文件内容的库,支持本地目录和嵌入目录文件的替换。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Replacer ¶
type Replacer interface { SetReplacementFields(fields []Field) // 设置替换字段 SetSubDirsAndFiles(subDirs []string, subFiles ...string) // 设置子目录和文件列表 SetIgnoreSubDirs(dirs ...string) // 设置忽略的子目录 SetIgnoreSubFiles(filenames ...string) // 设置忽略的文件 SetOutputDir(absDir string, name ...string) error // 设置输出目录 GetOutputDir() string // 获取输出目录 GetSourcePath() string // 获取源目录 SaveFiles() error // 保存文件 ReadFile(filename string) ([]byte, error) // 读取文件内容 GetFiles() []string // 获取文件列表 SaveTemplateFiles(m map[string]interface{}, parentDir ...string) error // 保存模板文件 }
Replacer 接口定义了文件替换器的行为
Click to show internal directories.
Click to hide internal directories.