Documentation ¶
Index ¶
- func CountPagesOfPDF(pdfFileName string) (int, error)
- func ExportAllImageFromPDF(pdfFile string)
- func ExportImageFromPDF(pdfFile string, pageNum int)
- func GetFileFromCache(id, filename, queryString string, isCover bool, cachePath string, debug bool) ([]byte, string, error)
- func GetImageFromPDF(pdfFileName string, pageNum int, Debug bool) ([]byte, error)
- func GetImageListFromEpubFile(epubPath string) (imageList []string, err error)
- func GetPageDimensions(fileName string) []dim
- func GetPictureData(option GetPictureDataOption) (imgData []byte, contentType string, err error)
- func GetQueryString(query url.Values) string
- func GetSingleFile(filePath, nameInArchive, textEncoding string) ([]byte, error)
- func SaveFileToCache(id, filename string, data []byte, queryString, contentType string, ...) error
- func ScanNonUTF8Zip(filePath string, textEncoding string) (reader *zip.Reader, err error)
- func UnArchiveRar(filePath string, extractPath string) error
- func UnArchiveZip(filePath string, extractPath string, textEncoding string) error
- type Container
- type EpubMetadata
- type GetPictureDataOption
- type Package
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountPagesOfPDF ¶
CountPagesOfPDF 确定PDF的页数
func ExportAllImageFromPDF ¶
func ExportAllImageFromPDF(pdfFile string)
func ExportImageFromPDF ¶
func GetFileFromCache ¶
func GetFileFromCache(id, filename, queryString string, isCover bool, cachePath string, debug bool) ([]byte, string, error)
GetFileFromCache 从缓存读取文件,加快第二次访问的速度
func GetImageFromPDF ¶
GetImageFromPDF 从PDF里面取jpeg文件,pageNum从1开始
func GetImageListFromEpubFile ¶
GetImageListFromEpubFile 根据Epub信息,获取有序的imgSrc列表
func GetPictureData ¶
func GetPictureData(option GetPictureDataOption) (imgData []byte, contentType string, err error)
func GetQueryString ¶
GetQueryString 根据查询参数生成一个排序后的键字符串
func GetSingleFile ¶
GetSingleFile 获取单个文件
func SaveFileToCache ¶
func SaveFileToCache(id, filename string, data []byte, queryString, contentType string, isCover bool, cachePath string, debug bool) error
SaveFileToCache 保存文件到缓存,加快读取速度
func ScanNonUTF8Zip ¶
ScanNonUTF8Zip 扫描文件,初始化书籍用
func UnArchiveRar ¶
UnArchiveRar 一次性解压 RAR 文件
Types ¶
type Container ¶
type Container struct { XMLName xml.Name `xml:"container"` Text string `xml:",chardata"` Version string `xml:"version,attr"` Xmlns string `xml:"xmlns,attr"` Rootfiles struct { Text string `xml:",chardata"` Rootfile struct { Text string `xml:",chardata"` FullPath string `xml:"full-path,attr"` MediaType string `xml:"media-type,attr"` } `xml:"rootfile"` } `xml:"rootfiles"` }
Container 定义结构体、映射xml结构 was generated 2022-12-09 00:41:31 by https://xml-to-go.github.io/ in Ukraine.
type EpubMetadata ¶
type EpubMetadata struct { Title string `xml:"title"` Language string `xml:"language"` Creator string `xml:"creator"` Publisher string `xml:"publisher"` Date string `xml:"date"` Rights string `xml:"rights"` Series string `xml:"series"` }
func GetEpubMetadata ¶
func GetEpubMetadata(epubPath string) (metadata EpubMetadata, err error)
GetEpubMetadata 根据Epub信息,获取书籍详情
type GetPictureDataOption ¶
type Package ¶
type Package struct { XMLName xml.Name `xml:"package"` Text string `xml:",chardata"` Version string `xml:"version,attr"` UniqueIdentifier string `xml:"unique-identifier,attr"` Xmlns string `xml:"xmlns,attr"` Metadata struct { Text string `xml:",chardata"` Dc string `xml:"dc,attr"` Opf string `xml:"opf,attr"` Meta []struct { Text string `xml:",chardata"` Name string `xml:"name,attr"` Content string `xml:"content,attr"` } `xml:"meta"` Identifier struct { Text string `xml:",chardata"` ID string `xml:"id,attr"` Scheme string `xml:"scheme,attr"` } `xml:"identifier"` Title string `xml:"title"` Language string `xml:"language"` Creator string `xml:"creator"` Publisher string `xml:"publisher"` Date string `xml:"date"` Rights string `xml:"rights"` Series string `xml:"series"` } `xml:"metadata"` Manifest struct { Text string `xml:",chardata"` Item []struct { Text string `xml:",chardata"` ID string `xml:"id,attr"` Href string `xml:"href,attr"` MediaType string `xml:"media-type,attr"` Properties string `xml:"properties,attr"` } `xml:"item"` } `xml:"manifest"` Spine struct { Text string `xml:",chardata"` Toc string `xml:"toc,attr"` Itemref []struct { Text string `xml:",chardata"` Idref string `xml:"idref,attr"` } `xml:"itemref"` } `xml:"spine"` Guide struct { Text string `xml:",chardata"` Reference struct { Text string `xml:",chardata"` Type string `xml:"type,attr"` Href string `xml:"href,attr"` Title string `xml:"title,attr"` } `xml:"reference"` } `xml:"guide"` }
Package 定义结构体、映射OPF文件(xml)结构用。 was generated 2022-12-09 00:47:41 by https://xml-to-go.github.io/ in Ukraine.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.