Documentation ¶
Index ¶
- func CreateMD5(filename string) (md5Str string, err error)
- func GenerateCover(this BookInfo)
- func KindlegenCmd(args ...string) *exec.Cmd
- func ReadAllString(filename string) string
- func WriteFile(filename string, data []byte) error
- type Boltdb
- func (this *Boltdb) Close() error
- func (this *Boltdb) Drop() error
- func (this Boltdb) FindAll() ([]Meta, error)
- func (this Boltdb) FindAllByAuthor(author string) ([]Meta, error)
- func (this Boltdb) FindOneByAuthor(author string) (Meta, error)
- func (this Boltdb) FindOneByBookName(bookname string) (Meta, error)
- func (this Boltdb) FindOneByFieldName(fieldname string, val string) (Meta, error)
- func (this Boltdb) FindOneByMD5(md5info string) (Meta, error)
- func (this Boltdb) FindOneByUUID(uuid string) (Meta, error)
- func (this *Boltdb) Save(metainfo Meta) error
- func (this *Boltdb) Update(metainfo Meta) error
- func (this *Boltdb) UpdateAzw3Info(uuid string, coverpath string, azw3path string, azw3md5 string) error
- func (this *Boltdb) UpdateEpubInfo(uuid string, coverpath string, epubpath string, epubmd5 string) error
- func (this *Boltdb) UpdateMobiInfo(uuid string, coverpath string, mobipath string, mobimd5 string) error
- func (this *Boltdb) UpdateTXTInfo(uuid string, txtpath string, txtmd5 string) error
- type BookInfo
- func (this *BookInfo) ChangeVolumeState(hasVolume bool)
- func (this BookInfo) DownloadCoverImage(coverURL string) error
- func (this BookInfo) GenerateEPUB() error
- func (this *BookInfo) GenerateISBN()
- func (this BookInfo) GenerateJSON() error
- func (this BookInfo) GenerateMobi()
- func (this BookInfo) GenerateTxt()
- func (this *BookInfo) GenerateUUID()
- func (this BookInfo) GetCover() error
- func (this BookInfo) ISBN() string
- func (this BookInfo) PrintVolumeInfo()
- func (this *BookInfo) SetISBN(value string)
- func (this *BookInfo) SetKindleEbookType(isMobi bool, isAzw3 bool)
- func (this BookInfo) Split() []BookInfo
- func (this BookInfo) UUID() string
- func (this BookInfo) VolumeState() bool
- type Chapter
- type EBookDLInterface
- type LatestReleasesInfo
- type Meta
- type ProxyChapter
- type Volume
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KindlegenCmd ¶ added in v1.2.0
KindlegenCmd 执行外部kindlegen命令
Types ¶
type Boltdb ¶ added in v1.7.6
type Boltdb struct {
// contains filtered or unexported fields
}
Boltdb 定义boltdb的接口
func InitBoltDB ¶ added in v1.7.6
InitBoltDB 初始化boltdb数据库,根据dbname
func (Boltdb) FindAllByAuthor ¶ added in v1.7.6
FindAllByAuthor 查询当前作者author在blotdb中所有的作品
func (Boltdb) FindOneByAuthor ¶ added in v1.7.6
FindOneByAuthor 通过author来查询boltdb中的单一条数据
func (Boltdb) FindOneByBookName ¶ added in v1.7.6
FindOneByName 通过Bookname来查询boltdb中的单一条数据
func (Boltdb) FindOneByFieldName ¶ added in v1.7.6
FindOneByFieldName 根据fieldname中定义的项目,进行查询,只返回一条结果
func (Boltdb) FindOneByMD5 ¶ added in v1.7.7
FindOneByMD5 通过电子书的md5信息来查询boltdb中的单一条数据
func (Boltdb) FindOneByUUID ¶ added in v1.7.6
FindOneByUUID 通过uuid查询boltdb中的单一条数据
func (*Boltdb) UpdateAzw3Info ¶ added in v1.7.6
func (this *Boltdb) UpdateAzw3Info(uuid string, coverpath string, azw3path string, azw3md5 string) error
UpdateAzw3Info 更新boltdb中uuid指定的azw3数据
func (*Boltdb) UpdateEpubInfo ¶ added in v1.7.6
func (this *Boltdb) UpdateEpubInfo(uuid string, coverpath string, epubpath string, epubmd5 string) error
UpdateEpubInfo 更新boltdb中uuid指定的epub数据
type BookInfo ¶
type BookInfo struct { EBHost string `json:"ebook_host"` //下载小说的网站 EBookID string `json:"ebook_id"` //对应小说网站的bookid BookISBN string `json:"isbn"` //生成一个isbn码 BookUUID string `json:"uuid"` //生成一个uuid码,准备用于boltdb Name string `json:"bookname"` //小说名字 Author string `json:"author"` //小说作者 Description string `json:"novel_description"` //小说简介 CoverURL string `json:"cover_url"` //小说封面图片地址 IsMobi bool `json:"is_mobi"` //当为true的时候生成mobi IsAzw3 bool `json:"is_azw3"` //当为true的时候生成azw3, HasVolume bool `json:"has_volume"` //是否有小说分卷,默认为false;当设置为true的时候,Volumes里面需要包含分卷信息 Volumes []Volume `json:"volumes"` //小说分卷信息,一般不设置 Chapters []Chapter `json:"chapters"` //小说章节信息 }
BookInfo 小说信息
func LoadBookJSONData ¶ added in v1.7.2
LoadBookJSONData 从文件中读取BookInfo信息,并返回
func (*BookInfo) ChangeVolumeState ¶ added in v1.6.0
ChangeVolumeState 设置 是否包含分卷信息
func (BookInfo) DownloadCoverImage ¶ added in v1.7.7
DownloadCoverImage 下载小说的封面图片
func (BookInfo) GenerateEPUB ¶ added in v1.7.3
GenerateEPUB 生成ebpub小说
func (*BookInfo) GenerateISBN ¶ added in v1.7.4
func (this *BookInfo) GenerateISBN()
GenerateISBN GenerateISBN
func (BookInfo) GenerateJSON ¶ added in v1.7.2
GenerateJSON 生成json格式的数据
func (*BookInfo) GenerateUUID ¶ added in v1.7.4
func (this *BookInfo) GenerateUUID()
GenerateUUID 根据小说的作者名和小说名 生成uuid码,使用UUID_V5格式
func (BookInfo) PrintVolumeInfo ¶ added in v1.6.0
func (this BookInfo) PrintVolumeInfo()
PrintVolumeInfo 用于打印 小说分卷信息
func (*BookInfo) SetKindleEbookType ¶ added in v1.5.0
SetKindleEbookType 现在设置,mobi和awz3格式不能同时设置为true
func (BookInfo) Split ¶ added in v1.7.1
Split BookInfo里面的Chapter,以300章为一组进行分割 当少于300章的里面,全部分为一卷;当有1000卷的时候,分为4卷; 当分割有n个卷的时候,剩下的章节大于50章,重开一个分卷,当少于50的时候,分割到最后一个分卷里面
func (BookInfo) VolumeState ¶ added in v1.6.0
VolumeState 返回 HasVolume的状态,true,false
type Chapter ¶
type Chapter struct { Title string `json:"title"` Content string `json:"content"` Link string `json:"chapter_url_link"` }
Chapter 定义小说章节信息
type EBookDLInterface ¶ added in v1.4.0
type EBookDLInterface interface { GetBookInfo(ctx context.Context, bookid string, proxy string) BookInfo //获取小说的所有信息,包含小说名,作者,简介等信息 GetBookBriefInfo(bookid string, proxy string) BookInfo //获取小说最基本的信息,不包含章节信息 DownloaderChapter(ResultChan chan chan Chapter, pc ProxyChapter, wg *sync.WaitGroup) DownloadChapters(Bi BookInfo, proxy string) BookInfo }
EBookDLInterface 小说下载器接口interface
type LatestReleasesInfo ¶ added in v1.7.3
LatestReleasesInfo 获取最新的Releases信息
func UpdateCheck ¶ added in v1.7.3
func UpdateCheck() (obj LatestReleasesInfo, err error)
UpdateCheck 检查更新
func (LatestReleasesInfo) Compare ¶ added in v1.7.3
func (ri LatestReleasesInfo) Compare(CurVersion string) string
Compare 对版本进行对比
func (LatestReleasesInfo) String ¶ added in v1.7.3
func (ri LatestReleasesInfo) String() string
String ReleaseInfo String()
type Meta ¶ added in v1.7.1
type Meta struct { Ebhost string `json:"ebhost" storm:"index"` Bookid string `json:"bookid"` BookName string `json:"bookname" storm:"index"` BookISBN string `json:"isbn" storm:"index"` BookUUID string `json:"uuid" storm:"id,index,unique"` Author string `json:"author" storm:"index"` CoverURL string `json:"cover_url"` Description string `json:"description"` TxtURLPath string `json:"txt_url_path"` MobiURLPath string `json:"mobi_url_path"` EPUBURLPath string `json:"epub_url_path"` AZW3URLPath string `json:"azw3_url_path"` TxtMD5 string `json:"txt_md5_info"` MobiMD5 string `json:"mobi_md5_info"` EPUBMD5 string `json:"epub_md5_info"` AZW3MD5 string `json:"azw3_md5_info"` }
Meta 小说的metainfo
func GetMetaData ¶ added in v1.7.1
GetMetaData 从文件中读取meta信息,并返回
type ProxyChapter ¶ added in v1.3.0
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Code generated for package fonts by go-bindata DO NOT EDIT.
|
Code generated for package fonts by go-bindata DO NOT EDIT. |
Package main Code generated by go-bindata.
|
Package main Code generated by go-bindata. |
Code generated for package tpls by go-bindata DO NOT EDIT.
|
Code generated for package tpls by go-bindata DO NOT EDIT. |