Documentation ¶
Index ¶
- func AddBooksToStore(bookList []*types.Book, basePath string, MinImageNum int)
- func ClearDatabaseWhenExit(ConfigPath string)
- func InitStore(scanConfig Option) error
- func SaveResultsToDatabase(ConfigPath string, ClearDatabaseWhenExit bool) error
- func ScanAndGetBookList(storePath string, scanOption Option) (newBookList []*types.Book, err error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBooksToStore ¶
AddBooksToStore 添加一组书到书库
func ClearDatabaseWhenExit ¶
func ClearDatabaseWhenExit(ConfigPath string)
func SaveResultsToDatabase ¶
SaveResultsToDatabase 4,保存扫描结果到数据库,并清理不存在的书籍
Types ¶
type Option ¶
type Option struct { ReScanFile bool // 是否重新扫描文件 StoresPath []string // 书库路径 MaxScanDepth int // 扫描深度 MinImageNum int // 最小图片数量 TimeoutLimitForScan int // 扫描超时时间 ExcludePath []string // 排除路径 SupportMediaType []string // 支持的媒体类型 SupportFileType []string // 支持的文件类型 ZipFileTextEncoding string // 非UTF-8编码的ZIP文件,尝试用什么编码解析,默认GBK EnableDatabase bool // 启用数据库 ClearDatabaseWhenExit bool // 启用数据库时,扫描完成后,清除不存在的书籍 Debug bool }
func NewScanOption ¶
func (*Option) IsSupportArchiver ¶
IsSupportArchiver 是否是支持的压缩文件
func (*Option) IsSupportMedia ¶
IsSupportMedia 判断压缩包内的文件是否需要展示(包括图片、音频、视频、PDF在内的媒体文件)
Click to show internal directories.
Click to hide internal directories.