Documentation
¶
Index ¶
- func AddBooksToStore(bookList []*entity.Book, basePath string, MinImageNum int)
- func ClearDatabaseWhenExit(ConfigPath string)
- func InitStore(scanConfig Option) error
- func Local(storePath string, scanOption Option) ([]*entity.Book, error)
- func SFTP(scanOption Option) (newBookList []*entity.Book, err error)
- func SaveResultsToDatabase(ConfigPath string, ClearDatabaseWhenExit bool) error
- func Smb(scanOption Option) (newBookList []*entity.Book, err error)
- func Webdav(scanOption Option) (newBookList []*entity.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,保存扫描结果到数据库,并清理不存在的书籍
func Smb ¶
Smb 扫描smb书籍 github.com/hirochachacha/go-smb2 换用一个持续更新,rclone用的库:github.com/cloudsoda/go-smb2 https://github.com/rclone/rclone/blob/master/go.mod
Types ¶
type Option ¶
type Option struct {
ReScanFile bool // 是否重新扫描文件
LocalStores []string // 本地书库路径
RemoteStores []stores.Store // 远程书库路径
MaxScanDepth int // 扫描深度
MinImageNum int // 最小图片数量
TimeoutLimitForScan int // 扫描超时时间
ExcludePath []string // 排除路径
SupportMediaType []string // 支持的媒体类型
SupportFileType []string // 支持的文件类型
SupportTemplateFile []string // 支持的模板文件类型,默认为html
ZipFileTextEncoding string // 非UTF-8编码的ZIP文件,尝试用什么编码解析,默认GBK
EnableDatabase bool // 启用数据库
ClearDatabaseWhenExit bool // 启用数据库时,扫描完成后,清除不存在的书籍
Debug bool
}
func NewScanOption ¶
func NewScanOption( reScanFile bool, localPath []string, remoteStores []stores.Store, maxScanDepth int, minImageNum int, timeoutLimitForScan int, excludePath []string, supportMediaType []string, supportFileType []string, supportTemplateFile []string, zipFileTextEncoding string, enableDatabase bool, clearDatabaseWhenExit bool, debug bool, ) Option
func (*Option) IsSupportArchiver ¶
IsSupportArchiver 是否是支持的压缩文件
func (*Option) IsSupportMedia ¶
IsSupportMedia 判断压缩包内的文件是否需要展示(包括图片、音频、视频、PDF在内的媒体文件)
func (*Option) IsSupportTemplate ¶
IsSupportTemplate 判断压缩包内的文件是否是支持的模板文件
Click to show internal directories.
Click to hide internal directories.