export AppCallback
This commit is contained in:
parent
1b06291e8d
commit
97de2fd06c
1 changed files with 4 additions and 4 deletions
8
tree.go
8
tree.go
|
@ -24,10 +24,10 @@ type Config struct {
|
||||||
AttachmentDirName string
|
AttachmentDirName string
|
||||||
CustomMeta map[string]func() string
|
CustomMeta map[string]func() string
|
||||||
Excludes []string
|
Excludes []string
|
||||||
Apps map[string]appCallback
|
Apps map[string]AppCallback
|
||||||
}
|
}
|
||||||
|
|
||||||
type appCallback func(dir string, content string, info os.FileInfo) (string, error)
|
type AppCallback func(dir string, content string, info os.FileInfo) (string, error)
|
||||||
|
|
||||||
type File struct {
|
type File struct {
|
||||||
Id string
|
Id string
|
||||||
|
@ -150,7 +150,7 @@ func NewConfig(
|
||||||
attachmentDirName string,
|
attachmentDirName string,
|
||||||
customMeta map[string]func() string,
|
customMeta map[string]func() string,
|
||||||
excludes []string,
|
excludes []string,
|
||||||
apps map[string]appCallback,
|
apps map[string]AppCallback,
|
||||||
) Config {
|
) Config {
|
||||||
return Config{
|
return Config{
|
||||||
ReadableFormats: readableFormats,
|
ReadableFormats: readableFormats,
|
||||||
|
@ -262,7 +262,7 @@ func moveAttachments(dir string, config Config) (map[string]string, error) {
|
||||||
return attachmentRegistry, err
|
return attachmentRegistry, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func applyApp(app appCallback, dir string, config Config) error {
|
func applyApp(app AppCallback, dir string, config Config) error {
|
||||||
err := filepath.Walk(dir, func(fullPath string, info os.FileInfo, e error) error {
|
err := filepath.Walk(dir, func(fullPath string, info os.FileInfo, e error) error {
|
||||||
if e != nil {
|
if e != nil {
|
||||||
return e
|
return e
|
||||||
|
|
Loading…
Reference in a new issue