Documentation
¶
Index ¶
- func AddBooksToStore(books []*model.Book)
- func GetCurrentFS() vfs.FileSystem
- func GetRemoteImageData(book *model.Book, imageName string) ([]byte, error)
- func InitAllStore(cfg ConfigInterface) error
- func InitConfig(c ConfigInterface)
- func InitStore(storePath string, cfg ConfigInterface) error
- func IsRemoteFS() bool
- func IsSkipDir(path string) bool
- func IsSupportFile(checkPath string) bool
- func IsSupportMedia(checkPath string) bool
- func IsSupportTemplate(checkPath string) bool
- func SaveBooksToDatabase(cfg ConfigInterface) error
- func SetCurrentFS(fs vfs.FileSystem)
- type ConfigInterface
- type DirNode
- type ScanFailureRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRemoteImageData ¶ added in v1.2.17
GetRemoteImageData 获取远程图片数据(用于目录类型书籍)
func InitConfig ¶
func InitConfig(c ConfigInterface)
func InitStore ¶
func InitStore(storePath string, cfg ConfigInterface) error
InitStore 扫描书库路径,取得路径里的书籍 支持本地路径和远程 URL(WebDAV 等)
func IsSupportTemplate ¶
IsSupportTemplate 判断压缩包内的文件是否是支持的模板文件
func SaveBooksToDatabase ¶
func SaveBooksToDatabase(cfg ConfigInterface) error
SaveBooksToDatabase 4,保存扫描结果到数据库
func SetCurrentFS ¶ added in v1.2.17
func SetCurrentFS(fs vfs.FileSystem)
SetCurrentFS 设置当前扫描使用的文件系统
Types ¶
type ConfigInterface ¶
type ConfigInterface interface {
GetStoreUrls() []string
GetMaxScanDepth() int
GetMinImageNum() int
GetTimeoutLimitForScan() int
GetExcludePath() []string
GetSupportMediaType() []string
GetSupportFileType() []string
GetSupportTemplateFile() []string
GetZipFileTextEncoding() string
GetEnableDatabase() bool
GetClearDatabaseWhenExit() bool
GetDebug() bool
}
type DirNode ¶
type DirNode struct {
Name string `json:"name"`
Path string `json:"path"`
SubDirs []DirNode `json:"sub_dirs"` // 子目录列表
Files []model.PageInfo `json:"files"` // 本目录下的图片文件列表
}
DirNode 表示目录树节点,用于表示文件系统中的目录结构。
func HandleDirectory ¶
HandleDirectory 扫描本地目录的核心函数:递归遍历目录,忽略指定名称的文件夹,收集图片文件信息
type ScanFailureRecord ¶ added in v1.2.28
type ScanFailureRecord struct {
StoreURL string `json:"store_url"`
FilePath string `json:"file_path"`
FileSize int64 `json:"file_size"`
ModifiedUnixNano int64 `json:"modified_unix_nano"`
CreatedByVersion string `json:"created_by_version"`
FailedAt time.Time `json:"failed_at"`
Error string `json:"error"`
IsRemote bool `json:"is_remote"`
}
ScanFailureRecord 记录压缩文件扫描失败时的文件指纹。 后续扫描仅在文件变化,或版本跨度足够大时才会再次尝试。
Click to show internal directories.
Click to hide internal directories.