MCPcopy
hub / github.com/fish2018/pansou / AsyncSearchPlugin

Interface AsyncSearchPlugin

plugin/plugin.go:21–43  ·  view source on GitHub ↗

============================================================ 第一部分:接口定义和类型 ============================================================ AsyncSearchPlugin 异步搜索插件接口

Source from the content-addressed store, hash-verified

19
20// AsyncSearchPlugin 异步搜索插件接口
21type AsyncSearchPlugin interface {
22 // Name 返回插件名称
23 Name() string
24
25 // Priority 返回插件优先级
26 Priority() int
27
28 // AsyncSearch 异步搜索方法
29 AsyncSearch(keyword string, searchFunc func(*http.Client, string, map[string]interface{}) ([]model.SearchResult, error), mainCacheKey string, ext map[string]interface{}) ([]model.SearchResult, error)
30
31 // SetMainCacheKey 设置主缓存键
32 SetMainCacheKey(key string)
33
34 // SetCurrentKeyword 设置当前搜索关键词(用于日志显示)
35 SetCurrentKeyword(keyword string)
36
37 // Search 兼容性方法(内部调用AsyncSearch)
38 Search(keyword string, ext map[string]interface{}) ([]model.SearchResult, error)
39
40 // SkipServiceFilter 返回是否跳过Service层的关键词过滤
41 // 对于磁力搜索等需要宽泛结果的插件,应返回true
42 SkipServiceFilter() bool
43}
44
45// PluginWithWebHandler 支持Web路由的插件接口
46// 插件可以选择实现此接口来注册自定义的HTTP路由

Callers 18

printServiceInfoFunction · 0.65
RegisterGlobalPluginFunction · 0.65
searchPageMethod · 0.65
parseSearchResultItemMethod · 0.65
searchImplMethod · 0.65
parseSearchItemMethod · 0.65
doRequestWithRetryMethod · 0.65
printServiceInfoFunction · 0.65
getPluginPriorityByNameFunction · 0.65
getPluginPriorityMethod · 0.65
searchPluginsMethod · 0.65

Calls

no outgoing calls

Tested by

no test coverage detected