core

package
Version: v0.0.0-...-3b4bda9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2016 License: GPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidComic comicType = iota
	Manga
	Manhwa
	Manhua
	Western
	Webcomic
	Other
)
View Source
const (
	ComicStatusInvalid comicStatus = iota
	ComicComplete
	ComicOngoing
	ComicOnHiatus
	ComicDiscontinued
)
View Source
const (
	Scheduled fetchType = iota
	Startup
	Manual
)

Variables

View Source
var (
	ComicsAboutToBeAdded = eventq.NewEventType()
	ComicsAdded          = eventq.NewEventType()

	ComicsAboutToBeRemoved = eventq.NewEventType()
	ComicsRemoved          = eventq.NewEventType()

	ComicsUpdateStatusChanged = eventq.NewEventType()

	ChapterListAboutToChange = eventq.NewEventType()
	ChapterListChanged       = eventq.NewEventType()
)

Functions

func CreateDB

func CreateDB(db *qdb.QDB) (err error)

func NewBakaUpdates

func NewBakaUpdates() *bakaUpdates

func NewBatoto

func NewBatoto() *batoto

func NewFetcher

func NewFetcher(settings *GlobalSettings, plugins ...Source) fetcher

func NewKissManga

func NewKissManga() *kissmanga

func NotificationModeValueNames

func NotificationModeValueNames() (names []string)

func ReadConfig

func ReadConfig(filename string) (contents []byte, err error)

func SQLChapterQuery

func SQLChapterQuery(rows *sql.Rows) (Chapter, ChapterIdentity, error)

func SQLChapterScanlationSchema

func SQLChapterScanlationSchema() string

func SQLChapterSchema

func SQLChapterSchema() string

func SQLComicSchema

func SQLComicSchema() string

func SQLSourceLinkSchema

func SQLSourceLinkSchema() string

func WriteConfig

func WriteConfig(filename string, data []byte)

Types

type Chapter

type Chapter struct {
	MarkedRead bool
	// contains filtered or unexported fields
}

func (*Chapter) AddScanlation

func (this *Chapter) AddScanlation(scanlation ChapterScanlation) (replaced bool)

func (*Chapter) MergeWith

func (this *Chapter) MergeWith(another *Chapter) *Chapter

func (*Chapter) RemoveScanlation

func (this *Chapter) RemoveScanlation(index int)

func (*Chapter) RemoveScanlationsForPlugin

func (this *Chapter) RemoveScanlationsForPlugin(pluginName SourceId)

func (*Chapter) Scanlation

func (this *Chapter) Scanlation(index int) ChapterScanlation

func (*Chapter) ScanlationsCount

func (this *Chapter) ScanlationsCount() int

func (*Chapter) Scanlators

func (this *Chapter) Scanlators() (ret []JointScanlatorIds)

type ChapterIdentitiesSlice

type ChapterIdentitiesSlice []ChapterIdentity

func (*ChapterIdentitiesSlice) Insert

func (this *ChapterIdentitiesSlice) Insert(at int, ci ChapterIdentity)

func (*ChapterIdentitiesSlice) InsertMultiple

func (this *ChapterIdentitiesSlice) InsertMultiple(at int, cis []ChapterIdentity)

func (*ChapterIdentitiesSlice) InsertMultipleIdentified

func (this *ChapterIdentitiesSlice) InsertMultipleIdentified(at int, cis []IdentifiedChapter)

func (ChapterIdentitiesSlice) Len

func (this ChapterIdentitiesSlice) Len() int

func (ChapterIdentitiesSlice) Less

func (this ChapterIdentitiesSlice) Less(i, j int) bool

func (ChapterIdentitiesSlice) Swap

func (this ChapterIdentitiesSlice) Swap(i, j int)

type ChapterIdentity

type ChapterIdentity struct {
	Volume   byte
	MajorNum uint16
	MinorNum byte
	Letter   byte
	// contains filtered or unexported fields
}

func ChapterIdentityFromInt64

func ChapterIdentityFromInt64(n int64) (ci ChapterIdentity)

func (ChapterIdentity) Equals

func (this ChapterIdentity) Equals(another ChapterIdentity) bool

func (ChapterIdentity) Less

func (this ChapterIdentity) Less(another ChapterIdentity) bool

func (ChapterIdentity) LessEq

func (this ChapterIdentity) LessEq(another ChapterIdentity) bool

func (ChapterIdentity) More

func (this ChapterIdentity) More(another ChapterIdentity) bool

func (ChapterIdentity) MoreEq

func (this ChapterIdentity) MoreEq(another ChapterIdentity) bool

func (*ChapterIdentity) Scan

func (this *ChapterIdentity) Scan(src interface{}) error

func (ChapterIdentity) Stringify

func (this ChapterIdentity) Stringify() string

type ChapterScanlation

type ChapterScanlation struct {
	SourceId    SourceId
	Scanlators  JointScanlatorIds
	Version     byte
	Color       bool
	Title       string
	Language    LangId
	MetadataURL string
	PageLinks   []string
	// contains filtered or unexported fields
}

func SQLChapterScanlationQuery

func SQLChapterScanlationQuery(rows *sql.Rows) (ChapterScanlation, error)

type Comic

type Comic struct {
	// contains filtered or unexported fields
}

func NewComic

func NewComic(cfg ComicConfig) Comic

func SQLComicQuery

func SQLComicQuery(rows *sql.Rows) (Comic, error)

func (*Comic) AddChapter

func (this *Comic) AddChapter(identity ChapterIdentity, chapter Chapter) (merged bool)

func (*Comic) AddMultipleChapters

func (this *Comic) AddMultipleChapters(identities []ChapterIdentity, chapters []Chapter)
func (this *Comic) AddSourceLink(link SourceLink) (alreadyAdded bool)

func (*Comic) AddSourceLinkAt

func (this *Comic) AddSourceLinkAt(index int, link SourceLink) (alreadyAdded bool)

func (*Comic) Chapter

func (this *Comic) Chapter(index int) (*Chapter, ChapterIdentity)

func (*Comic) ChaptersCount

func (this *Comic) ChaptersCount() int

func (*Comic) ChaptersReadCount

func (this *Comic) ChaptersReadCount() int

func (*Comic) Config

func (this *Comic) Config() ComicConfig

func (*Comic) GetChapter

func (this *Comic) GetChapter(index int) (Chapter, ChapterIdentity)

func (*Comic) Info

func (this *Comic) Info() ComicInfo

func (*Comic) LastReadChapter

func (this *Comic) LastReadChapter() int

func (*Comic) PreferredScanlators

func (this *Comic) PreferredScanlators() map[JointScanlatorIds]jointIdx

func (*Comic) PreferredSources

func (this *Comic) PreferredSources() map[SourceId]linkIdx

func (*Comic) PrefersColor

func (this *Comic) PrefersColor() bool

func (*Comic) QueuedChapter

func (this *Comic) QueuedChapter() int

func (*Comic) RemoveSource

func (this *Comic) RemoveSource(link SourceLink) (success bool)

func (*Comic) SQLId

func (this *Comic) SQLId() int64

func (*Comic) SQLInsert

func (this *Comic) SQLInsert() (err error)

func (*Comic) Scanlators

func (this *Comic) Scanlators() []JointScanlatorIds

func (*Comic) SetColorPreference

func (this *Comic) SetColorPreference(prefersColor bool)

func (*Comic) SetConfig

func (this *Comic) SetConfig(cfg ComicConfig)

func (*Comic) SetInfo

func (this *Comic) SetInfo(info ComicInfo)

func (*Comic) SetPreferredScanlators

func (this *Comic) SetPreferredScanlators(priority []JointScanlatorIds)
func (this *Comic) SourceLinks() []SourceLink

type ComicConfig

type ComicConfig struct {
	OverrideDefaults []bool
	CommonSettings
	DownloadPath string
}

func NewComicConfig

func NewComicConfig(defaults *GlobalSettings) ComicConfig

func (*ComicConfig) Valid

func (this *ComicConfig) Valid() bool

type ComicInfo

type ComicInfo struct {
	MainTitleIdx     int
	Titles           []string
	Authors          []AuthorId
	Artists          []ArtistId
	Genres           []ComicGenreId
	Categories       []ComicTagId
	Type             comicType
	Status           comicStatus
	ScanlationStatus ScanlationStatus
	Description      string
	Rating           uint16
	Mature           bool
	ThumbnailIdx     int
	Thumbnails       []string
}

func (ComicInfo) MergeWith

func (this ComicInfo) MergeWith(another *ComicInfo) (merged ComicInfo)

type ComicList

type ComicList struct {
	eventq.Messenger
	// contains filtered or unexported fields
}

func NewComicList

func NewComicList(fetcher fetcher) *ComicList

func (*ComicList) AddComics

func (this *ComicList) AddComics(comics ...Comic)

func (*ComicList) Artists

func (list *ComicList) Artists() *idsdict.ArtistsDict

func (*ComicList) Authors

func (list *ComicList) Authors() *idsdict.AuthorsDict

func (ComicList) ComicIsUpdating

func (this ComicList) ComicIsUpdating(idx int) bool

func (ComicList) ComicLastUpdated

func (this ComicList) ComicLastUpdated(idx int) time.Time

func (*ComicList) Fetcher

func (list *ComicList) Fetcher() *fetcher

func (*ComicList) Genres

func (list *ComicList) Genres() *idsdict.ComicGenresDict

func (ComicList) GetComic

func (this ComicList) GetComic(idx int) *Comic

func (*ComicList) Langs

func (list *ComicList) Langs() *idsdict.LangsDict

func (*ComicList) Len

func (this *ComicList) Len() int

func (*ComicList) LoadFromDB

func (list *ComicList) LoadFromDB() (err error)

func (*ComicList) RemoveComics

func (this *ComicList) RemoveComics(index, count int)

func (*ComicList) Scanlators

func (list *ComicList) Scanlators() *idsdict.ScanlatorsDict

func (ComicList) ScheduleComicFetches

func (this ComicList) ScheduleComicFetches()

func (*ComicList) Tags

func (list *ComicList) Tags() *idsdict.ComicTagsDict

func (ComicList) UpdateComic

func (this ComicList) UpdateComic(comicId int)

type ComicUpdatingEnum

type ComicUpdatingEnum uint32
const (
	ComicNotUpdating ComicUpdatingEnum = iota
	ComicUpdating
)

type CommonSettings

type CommonSettings struct {
	FetchOnStartup        bool
	IntervalFetching      bool
	FetchFrequency        Duration
	NotificationMode      NotificationMode
	AccumulativeModeCount uint
	DelayedModeDuration   Duration
}

type DataCache

type DataCache struct {
	// contains filtered or unexported fields
}

func NewDataCache

func NewDataCache() *DataCache

func (*DataCache) Add

func (this *DataCache) Add(key string, b []byte, longevity time.Duration)

func (*DataCache) Get

func (this *DataCache) Get(key string) (b []byte, ok bool)

type Duration

type Duration time.Duration

func (Duration) MarshalJSON

func (this Duration) MarshalJSON() ([]byte, error)

func (Duration) MarshalQML

func (this Duration) MarshalQML() interface{}

func (*Duration) Scan

func (this *Duration) Scan(src interface{}) error

func (Duration) Split

func (this Duration) Split() (s splitDuration)

func (*Duration) UnmarshalJSON

func (this *Duration) UnmarshalJSON(data []byte) error

func (*Duration) UnmarshalQML

func (this *Duration) UnmarshalQML(data interface{}) (err error)

func (Duration) Value

func (this Duration) Value() (driver.Value, error)

type GlobalSettings

type GlobalSettings struct {
	CommonSettings
	IAmADirtyLeecher     bool
	MaxConnectionsToHost uint
	DownloadsPath        string
	Plugins              map[SourceId]PluginEnabled   `json:"PluginsEnabled"`
	Languages            map[LangName]LanguageEnabled `json:"LangsEnabled"` //TODO: languages validation
	Ignore_JSONComment0  []string                     `json:"#ValidNModeValues"`
}

func LoadGlobalSettings

func LoadGlobalSettings() (settings *GlobalSettings, e error)

func NewGlobalSettings

func NewGlobalSettings() *GlobalSettings

func (*GlobalSettings) Save

func (this *GlobalSettings) Save()

type IdentifiedChapter

type IdentifiedChapter struct {
	// contains filtered or unexported fields
}

type LangName

type LangName string

type LanguageEnabled

type LanguageEnabled bool

type NotificationMode

type NotificationMode int
const (
	Immediate NotificationMode = iota
	Accumulative
	Delayed
)

func (NotificationMode) MarshalJSON

func (this NotificationMode) MarshalJSON() ([]byte, error)

func (NotificationMode) String

func (i NotificationMode) String() string

func (*NotificationMode) UnmarshalJSON

func (this *NotificationMode) UnmarshalJSON(data []byte) error

type PluginEnabled

type PluginEnabled bool

type ScanlationStatus

type ScanlationStatus int
const (
	ScanlationStatusInvalid ScanlationStatus = iota
	ScanlationComplete
	ScanlationOngoing
	ScanlationOnHiatus
	ScanlationDropped
	ScanlationInDesperateNeedOfMoreStaff
)

type Source

type Source interface {
	Id() SourceId
	Name() string
	Languages() []string
	Capabilities() SourceCapabilities
	Config() SourceConfig
	SetConfig(cfg SourceConfig)
	IsURLValid(url string) bool
	// contains filtered or unexported methods
}

type SourceCapabilities

type SourceCapabilities struct {
	ProvidesMetadata bool
	ProvidesData     bool
}

type SourceConfig

type SourceConfig struct {
	OverrideDefaults []bool
	CommonSettings
	MaxConnectionsToHost uint
	Languages            map[LangName]LanguageEnabled
}

func NewSourceConfig

func NewSourceConfig(defaults *GlobalSettings) SourceConfig

type SourceId

type SourceId string

func (*SourceId) Scan

func (this *SourceId) Scan(src interface{}) error
type SourceLink struct {
	SourceId   SourceId
	URL        string
	MarkAsRead bool
	// contains filtered or unexported fields
}

func SQLSourceLinkQuery

func SQLSourceLinkQuery(rows *sql.Rows) (SourceLink, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL