Documentation ¶
Index ¶
- Constants
- Variables
- type Archive
- func (a *Archive) CoverFile() ([]byte, error)
- func (a *Archive) Exists() bool
- func (a *Archive) FilenameWithExt() string
- func (a *Archive) Filesize() float64
- func (a *Archive) ReaderForFile(fp string) (io.Reader, int64, error)
- func (a *Archive) ThumbnailFile() ([]byte, error)
- func (a *Archive) Walk(f func(f archiver.File) error) error
- type Cover
- type EntryMetadata
- type Page
- type ParsedEntry
- type ParsedSeries
- type SeriesMetadata
Constants ¶
View Source
const ( ChapterZeroValue = -1 VolumeZeroValue = -1 AuthorZeroValue = "" TitleZeroValue = "" )
View Source
const ( DefaultMaxWidth = 300 DefaultMaxHeight = 300 )
Variables ¶
View Source
var ( ErrCoverNotExist = errors.New("cover does not exist") ErrArchiveFileNotFound = errors.New("file not found in archive") )
View Source
var (
TimeZeroValue = time.Time{}
)
Functions ¶
This section is empty.
Types ¶
type Archive ¶
type Archive struct { Title string `json:"title"` // Title of the archive (filename without the extension) Path string `json:"path"` // Path to the archive on the filesystem Type archive.Type `json:"type"` // What file format is the archive e.g. zip/rar Cover *Cover `json:"cover"` // Link to the embedded cover in the archive ModTime time.Time `json:"mod_time"` // Modified time of the archive }
func UnmarshalArchive ¶
func (*Archive) FilenameWithExt ¶
func (*Archive) ReaderForFile ¶
func (*Archive) ThumbnailFile ¶
type Cover ¶
type Cover struct { Fp string `json:"file"` // Filepath ImageType image.Type `json:"image_type"` // What type is the image, e.g. PNG, JPEG, ... }
Cover is a filepath to an image file which represents the cover of the manga entry
func UnmarshalCover ¶
func (*Cover) ExistsOnFS ¶
func (*Cover) ThumbnailFile ¶
type EntryMetadata ¶
type EntryMetadata struct { Title string `json:"title"` Chapter int `json:"chapter"` Volume int `json:"volume"` Author string `json:"author"` DateReleased *date.Date `json:"date_released"` }
func NewEntryMetadata ¶
func NewEntryMetadata() *EntryMetadata
func UnmarshalEntryMetadata ¶
func UnmarshalEntryMetadata(data []byte) *EntryMetadata
type Page ¶
type Page struct { ImageType image.Type `json:"image_type"` // Image encoding e.g. ".png" Path string `json:"path"` // Path to the file in the archive }
func UnmarshalPage ¶
type ParsedEntry ¶
type ParsedEntry struct { Order int // 1-indexed order Archive *Archive // EntriesMetadata about the manga archive file Metadata *EntryMetadata // Metadata of the manga Pages []*Page // Pages of the manga }
ParsedEntry represents an entry which you read, i.e. an archive file
func ParseArchive ¶
func ParseArchive(fp string) (*ParsedEntry, error)
type ParsedSeries ¶
type ParsedSeries struct { Title string // Title of the ParsedSeries Entries []*ParsedEntry // Slice of all entries in the series }
ParsedSeries is a collection of ParsedEntry volumes/chapters
func ParseSeriesFolder ¶
func ParseSeriesFolder(dir string) (*ParsedSeries, error)
type SeriesMetadata ¶
type SeriesMetadata struct { Title string `json:"title"` Author string `json:"author"` DateReleased *date.Date `json:"date_released"` }
func UnmarshalSeriesMetadata ¶
func UnmarshalSeriesMetadata(data []byte) *SeriesMetadata
Click to show internal directories.
Click to hide internal directories.