Files
2022-01-15 15:50:35 +11:00

23 lines
500 B
Go

package plg_search_example
import (
. "github.com/mickael-kerjean/filestash/server/common"
)
func init() {
Hooks.Register.SearchEngine(ExampleSearch{})
}
type ExampleSearch struct{}
func (this ExampleSearch) Query(app App, path string, keyword string) ([]IFile, error) {
files := []IFile{}
files = append(files, File{
FName: "keyword-" + keyword + ".txt",
FType: "file", // ENUM("file", "directory")
FSize: 42,
FPath: "/fullpath/keyword-" + keyword + ".txt",
})
return files, nil
}