Documentation
¶
Overview ¶
plugin
Index ¶
- Constants
- func FormatTxt(lineList [][]byte, linewidth int, h func(float64)) [][]byte
- func GetLocalSavePath() string
- func GetLocalSavedFilePath(bookname string) string
- func GetSubsSavePath() string
- func InitPlugins() error
- func IsPrecreatedChapterTitle(line []byte, bookMarkRune rune) bool
- type Plugin
- type PluginList
- type SearchResult
- type SearchResultList
- type Subscription
- type SubscriptionList
- func (slist *SubscriptionList) Append(val *Subscription)
- func (slist *SubscriptionList) Fields() []string
- func (slist *SubscriptionList) Filter(kw string, i int)
- func (slist *SubscriptionList) Get() []*Subscription
- func (slist *SubscriptionList) Item(id int) []string
- func (slist *SubscriptionList) Len() int
- func (slist *SubscriptionList) Load() error
- func (slist *SubscriptionList) Remove(id int)
- func (slist *SubscriptionList) Save() error
- func (slist *SubscriptionList) Sort(field int, ascend bool)
- func (slist *SubscriptionList) Update(id int, newval *Subscription)
Constants ¶
View Source
const ( DownloadResultNotStarted uint32 = iota DownloadResultWorking DownloadResultFailed DownloadResultFinished )
View Source
const ( // default value of minimal line length in Chars for FormatTxt() DefaultFormatMinimalLineWidthInChars = 500 // max allowed number of newlines only line in a row for FormatTxt() MaxChainedNewlines = 0 BookMarkChar = "»" ParagraphPrefix = "" )
View Source
const SubsFileName = "golitebook.subs"
Variables ¶
This section is empty.
Functions ¶
func GetLocalSavePath ¶
func GetLocalSavePath() string
func GetLocalSavedFilePath ¶
func GetSubsSavePath ¶
func GetSubsSavePath() string
func InitPlugins ¶ added in v0.2.1
func InitPlugins() error
Types ¶
type Plugin ¶
func (*Plugin) GetBookInfo ¶
GetBookInfo returns total chapter count and name of last chapter
func (*Plugin) SearchBook ¶
func (p *Plugin) SearchBook(kw string) (SearchResultList, error)
type PluginList ¶
var LoadedPlugins PluginList
func (PluginList) KillAll ¶
func (list PluginList) KillAll()
func (PluginList) NameList ¶
func (list PluginList) NameList() []string
type SearchResult ¶
type SearchResultList ¶
type SearchResultList []*SearchResult
func (SearchResultList) Fields ¶
func (srl SearchResultList) Fields() []string
Fields return the field names
func (SearchResultList) Filter ¶
func (srl SearchResultList) Filter(kw string, i int)
func (SearchResultList) Item ¶
func (srl SearchResultList) Item(id int) []string
Item return item with index i, as a slice of strings, each string represents a field's value
func (SearchResultList) Len ¶
func (srl SearchResultList) Len() int
Len return total number of items
func (SearchResultList) Sort ¶
func (srl SearchResultList) Sort(field int, ascend bool)
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
func NewSubscription ¶
func NewSubscription(name, bookurl string, pluginName string, h func(string, int, int)) *Subscription
NewSubscription create a new subscription, download whole book, via book url
func (*Subscription) MarshalJSON ¶
func (sub *Subscription) MarshalJSON() ([]byte, error)
func (*Subscription) SetHandler ¶
func (task *Subscription) SetHandler(h func(string, int, int))
func (*Subscription) SetStatusTxt ¶
func (task *Subscription) SetStatusTxt(t string)
func (*Subscription) Status ¶
func (task *Subscription) Status() uint32
func (*Subscription) UnmarshalJSON ¶
func (sub *Subscription) UnmarshalJSON(buf []byte) error
func (*Subscription) Update ¶
func (sub *Subscription) Update()
Update use sub.StartingChapter and getbookinfo() to update the book to the latest
type SubscriptionList ¶
type SubscriptionList struct {
// contains filtered or unexported fields
}
key is the bookname
var CurrentSubscriptions *SubscriptionList
func NewSubscriptionList ¶
func NewSubscriptionList() *SubscriptionList
func (*SubscriptionList) Append ¶
func (slist *SubscriptionList) Append(val *Subscription)
func (*SubscriptionList) Fields ¶
func (slist *SubscriptionList) Fields() []string
func (*SubscriptionList) Filter ¶
func (slist *SubscriptionList) Filter(kw string, i int)
func (*SubscriptionList) Get ¶
func (slist *SubscriptionList) Get() []*Subscription
func (*SubscriptionList) Item ¶
func (slist *SubscriptionList) Item(id int) []string
func (*SubscriptionList) Len ¶
func (slist *SubscriptionList) Len() int
func (*SubscriptionList) Load ¶
func (slist *SubscriptionList) Load() error
func (*SubscriptionList) Remove ¶
func (slist *SubscriptionList) Remove(id int)
func (*SubscriptionList) Save ¶
func (slist *SubscriptionList) Save() error
func (*SubscriptionList) Sort ¶
func (slist *SubscriptionList) Sort(field int, ascend bool)
func (*SubscriptionList) Update ¶
func (slist *SubscriptionList) Update(id int, newval *Subscription)
Click to show internal directories.
Click to hide internal directories.