Documentation
¶
Index ¶
- func AddBooksToStore(bookList []*model.Book, basePath string, MinImageNum int)
- func ClearDatabaseWhenExit(ConfigPath string)
- func HandleDirectory(currentPath string, depth int, option Option) (model.DirNode, []string, []model.MediaFileInfo, error)
- func InitAllStore(option Option) error
- func InitStore(storePath string, option Option) ([]*model.Book, error)
- func SFTP(scanOption Option) (newBookList []*model.Book, err error)
- func SaveResultsToDatabase(ConfigPath string, ClearDatabaseWhenExit bool) error
- func Smb(scanOption Option) (newBookList []*model.Book, err error)
- func Webdav(scanOption Option) (newBookList []*model.Book, err error)
- type ConfigInterface
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBooksToStore ¶
AddBooksToStore 添加一组书到书库
func ClearDatabaseWhenExit ¶
func ClearDatabaseWhenExit(ConfigPath string)
func HandleDirectory ¶
func HandleDirectory(currentPath string, depth int, option Option) (model.DirNode, []string, []model.MediaFileInfo, error)
HandleDirectory 扫描目录的核心函数:递归遍历目录,忽略指定名称的文件夹,收集图片文件信息
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 ConfigInterface ¶
type ConfigInterface interface {
GetLocalStores() []string
GetStores() []stores.Store
GetMaxScanDepth() int
GetMinImageNum() int
GetTimeoutLimitForScan() int
GetExcludePath() []string
GetSupportMediaType() []string
GetSupportFileType() []string
GetSupportTemplateFile() []string
GetZipFileTextEncoding() string
GetEnableDatabase() bool
GetClearDatabaseWhenExit() bool
GetDebug() bool
}
type Option ¶
type Option struct {
Cfg ConfigInterface
}
func NewOption ¶
func NewOption(scanConfig ConfigInterface) Option
func (*Option) IsSupportArchiver ¶
IsSupportArchiver 是否是支持的压缩文件
func (*Option) IsSupportFile ¶
IsSupportFile 判断压缩包内的文件是否需要展示
func (*Option) IsSupportMedia ¶
IsSupportMedia 判断文件是否需要展示
func (*Option) IsSupportTemplate ¶
IsSupportTemplate 判断压缩包内的文件是否是支持的模板文件
Click to show internal directories.
Click to hide internal directories.