Documentation ¶
Index ¶
- Variables
- type BaseEntry
- type BlobDecoderFactory
- type BlobReader
- type CompressedBlobReader
- func NewCompressedBlobReader(reader *Reader, decoderFactory BlobDecoderFactory, ...) *CompressedBlobReader
- func NewXZBlobReader(reader *Reader, clusterStartOffset, clusterEndOffset uint64, blobIndex uint32, ...) *CompressedBlobReader
- func NewZStdBlobReader(reader *Reader, clusterStartOffset, clusterEndOffset uint64, blobIndex uint32, ...) *CompressedBlobReader
- type ContentEntry
- type Entry
- type EntryIterator
- type MetadataKey
- type Namespace
- type NoopReadSeekCloser
- type OptionFunc
- type Options
- type ReadAtCloser
- type Reader
- func (r *Reader) Close() error
- func (r *Reader) ClusterCount() uint32
- func (r *Reader) Entries() *EntryIterator
- func (r *Reader) EntryAt(idx int) (Entry, error)
- func (r *Reader) EntryCount() uint32
- func (r *Reader) EntryWithFullURL(url string) (Entry, error)
- func (r *Reader) EntryWithTitle(ns Namespace, title string) (Entry, error)
- func (r *Reader) EntryWithURL(ns Namespace, url string) (Entry, error)
- func (r *Reader) Favicon() (*ContentEntry, error)
- func (r *Reader) MainPage() (Entry, error)
- func (r *Reader) Metadata(keys ...MetadataKey) (map[MetadataKey]string, error)
- func (r *Reader) UUID() string
- func (r *Reader) Version() (majorVersion, minorVersion uint16)
- type RedirectEntry
- type UncompressedBlobReader
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BlobDecoderFactory ¶
type BlobDecoderFactory func(io.Reader) (io.ReadSeekCloser, error)
type BlobReader ¶
type BlobReader interface { io.ReadSeekCloser Size() (int64, error) }
type CompressedBlobReader ¶
type CompressedBlobReader struct {
// contains filtered or unexported fields
}
func NewCompressedBlobReader ¶
func NewCompressedBlobReader(reader *Reader, decoderFactory BlobDecoderFactory, clusterStartOffset, clusterEndOffset uint64, blobIndex uint32, blobSize int) *CompressedBlobReader
func NewXZBlobReader ¶
func NewXZBlobReader(reader *Reader, clusterStartOffset, clusterEndOffset uint64, blobIndex uint32, blobSize int) *CompressedBlobReader
func NewZStdBlobReader ¶
func NewZStdBlobReader(reader *Reader, clusterStartOffset, clusterEndOffset uint64, blobIndex uint32, blobSize int) *CompressedBlobReader
func (*CompressedBlobReader) Close ¶
func (r *CompressedBlobReader) Close() error
Close implements io.ReadCloser.
func (*CompressedBlobReader) Read ¶
func (r *CompressedBlobReader) Read(p []byte) (int, error)
Read implements io.ReadCloser.
func (*CompressedBlobReader) Seek ¶
func (r *CompressedBlobReader) Seek(offset int64, whence int) (int64, error)
Seek implements BlobReader.
func (*CompressedBlobReader) Size ¶
func (r *CompressedBlobReader) Size() (int64, error)
Size implements BlobReader.
type ContentEntry ¶
type ContentEntry struct { *BaseEntry // contains filtered or unexported fields }
func (*ContentEntry) Compression ¶
func (e *ContentEntry) Compression() (int, error)
func (*ContentEntry) MimeType ¶
func (e *ContentEntry) MimeType() string
func (*ContentEntry) Reader ¶
func (e *ContentEntry) Reader() (BlobReader, error)
func (*ContentEntry) Redirect ¶
func (e *ContentEntry) Redirect() (*ContentEntry, error)
type EntryIterator ¶
type EntryIterator struct {
// contains filtered or unexported fields
}
func (*EntryIterator) Entry ¶
func (it *EntryIterator) Entry() Entry
func (*EntryIterator) Err ¶
func (it *EntryIterator) Err() error
func (*EntryIterator) Index ¶
func (it *EntryIterator) Index() int
func (*EntryIterator) Next ¶
func (it *EntryIterator) Next() bool
type MetadataKey ¶
type MetadataKey string
const ( MetadataName MetadataKey = "Name" MetadataTitle MetadataKey = "Title" MetadataDescription MetadataKey = "Description" MetadataLongDescription MetadataKey = "LongDescription" MetadataCreator MetadataKey = "Creator" MetadataTags MetadataKey = "Tags" MetadataDate MetadataKey = "Date" MetadataPublisher MetadataKey = "Publisher" MetadataFlavour MetadataKey = "Flavour" MetadataSource MetadataKey = "Source" MetadataLanguage MetadataKey = "Language" MetadataIllustration48x48at1 MetadataKey = "Illustration_48x48@1" MetadataIllustration96x96at2 MetadataKey = "Illustration_96x96@2" )
type Namespace ¶
type Namespace string
const ( V5NamespaceLayout Namespace = "-" V5NamespaceArticle Namespace = "A" V5NamespaceArticleMetadata Namespace = "B" V5NamespaceImageFile Namespace = "I" V5NamespaceImageText Namespace = "J" V5NamespaceMetadata Namespace = "M" V5NamespaceCategoryText Namespace = "U" V5NamespaceCategoryArticleList Namespace = "V" V5NamespaceCategoryPerArticle Namespace = "W" V5NamespaceSearch Namespace = "X" )
type NoopReadSeekCloser ¶
type NoopReadSeekCloser struct {
io.ReadSeeker
}
func (*NoopReadSeekCloser) Close ¶
func (*NoopReadSeekCloser) Close() error
Close implements io.Closer.
type OptionFunc ¶
type OptionFunc func(opts *Options)
func WithCacheSize ¶
func WithCacheSize(size int) OptionFunc
type Options ¶
func NewOptions ¶
func NewOptions(funcs ...OptionFunc) *Options
type ReadAtCloser ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func NewReader ¶
func NewReader(r ReadAtCloser, funcs ...OptionFunc) (*Reader, error)
func (*Reader) ClusterCount ¶
func (*Reader) Entries ¶
func (r *Reader) Entries() *EntryIterator
func (*Reader) EntryCount ¶
func (*Reader) EntryWithTitle ¶
func (*Reader) EntryWithURL ¶
func (*Reader) Favicon ¶
func (r *Reader) Favicon() (*ContentEntry, error)
func (*Reader) Metadata ¶
func (r *Reader) Metadata(keys ...MetadataKey) (map[MetadataKey]string, error)
Metadata returns a copy of the internal metadata map of the ZIM file.
type RedirectEntry ¶
type RedirectEntry struct { *BaseEntry // contains filtered or unexported fields }
func (*RedirectEntry) Redirect ¶
func (e *RedirectEntry) Redirect() (*ContentEntry, error)
type UncompressedBlobReader ¶
type UncompressedBlobReader struct {
// contains filtered or unexported fields
}
func NewUncompressedBlobReader ¶
func NewUncompressedBlobReader(reader *Reader, blobStartOffset, blobEndOffset uint64, blobSize int) *UncompressedBlobReader
func (*UncompressedBlobReader) Close ¶
func (r *UncompressedBlobReader) Close() error
Close implements io.ReadCloser.
func (*UncompressedBlobReader) Read ¶
func (r *UncompressedBlobReader) Read(p []byte) (n int, err error)
Read implements io.ReadCloser.
func (*UncompressedBlobReader) Seek ¶
func (r *UncompressedBlobReader) Seek(offset int64, whence int) (int64, error)
Seek implements BlobReader.
func (*UncompressedBlobReader) Size ¶
func (r *UncompressedBlobReader) Size() (int64, error)
Size implements BlobReader.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.