How fish2018/pansou works
PanSou is a Go API for searching cloud-drive resources through Telegram channels and extensible plugins, and checking whether shared links remain valid. The main workflow accepts a search request, runs selected sources concurrently, then returns classified and ranked results; link checks follow a separate API path. Authentication is optional. The README documents asynchronous plugin work and two-level caching. Source excerpts show the search, plugin, and cache wiring; unsampled integrations are represented only where documented, and individual plugin call paths are not inferred.
Main entry points: search_service.go Search orchestration · router.go HTTP router · delayed_batch_write_manager.go Batch cache writer · handler.go Search endpoint
Components 16
API access
- HTTP router
api/router.go - Authentication
api/auth_handler.go - Search endpoint
api/handler.go - Link-check endpoint
api/check_handler.go
Search workflow
- Search orchestration
service/search_service.go - Worker pool
util/pool/worker_pool.go - Result parsing
util/parser_util.go
Search sources
- Plugin manager
plugin/plugin.go - Plugin sources
plugin
Caching and checks
- Two-level cache
util/cache/enhanced_two_level_cache.go - Batch cache writer
util/cache/delayed_batch_write_manager.go - Write buffer
util/cache/global_buffer_manager.go - Link-check service
service/check_service.go - Check cache store
service/check_service.go
Other components
- API client
- Telegram channels
Connections 16
- API client → HTTP router: sends requests
- HTTP router → Authentication: applies middleware
api/router.go - HTTP router → Search endpoint: routes search
api/router.go - HTTP router → Link-check endpoint: routes checks
api/router.go - Search endpoint → Search orchestration: calls search
api/handler.go - Link-check endpoint → Link-check service: checks links
- Search orchestration → Plugin manager: dispatches plugins
service/search_service.go - Plugin manager → Plugin sources: registers plugins
- Search orchestration → Worker pool: runs batches
service/search_service.go - Search orchestration → Telegram channels: searches channels
- Search orchestration → Result parsing: extracts links
service/search_service.go - Search orchestration → Two-level cache: reads and writes
service/search_service.go - Search orchestration → Batch cache writer: schedules writes
- Batch cache writer → Write buffer: buffers writes
util/cache/delayed_batch_write_manager.go - Batch cache writer → Two-level cache: updates cache
- Link-check service → Check cache store: persists checks
service/check_service.go