Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alist-org
GitHub Repository: alist-org/alist
Path: blob/main/internal/search/searcher/searcher.go
1560 views
1
package searcher
2
3
import (
4
"context"
5
6
"github.com/alist-org/alist/v3/internal/model"
7
)
8
9
type Config struct {
10
Name string
11
AutoUpdate bool
12
}
13
14
type Searcher interface {
15
// Config of the searcher
16
Config() Config
17
// Search specific keywords in specific path
18
Search(ctx context.Context, req model.SearchReq) ([]model.SearchNode, int64, error)
19
// Index obj with parent
20
Index(ctx context.Context, node model.SearchNode) error
21
// BatchIndex obj with parent
22
BatchIndex(ctx context.Context, nodes []model.SearchNode) error
23
// Get by parent
24
Get(ctx context.Context, parent string) ([]model.SearchNode, error)
25
// Del with prefix
26
Del(ctx context.Context, prefix string) error
27
// Release resource
28
Release(ctx context.Context) error
29
// Clear all index
30
Clear(ctx context.Context) error
31
}
32
33