archive

package
v0.0.0-...-ae62ce3 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: GPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MaxArchiveEntries = 4096 * 64
)

Variables

View Source
var ArchiveExtensions = []string{".zip", ".cbz"}

var ArchiveExtensions = []string{".zip", ".cbz", ".7z", ".rar", ".tar", ".tgz", ".tbz2", ".cb7", ".cbr", ".cbt"}

View Source
var (
	ErrBounds = errors.New("Image index out of bounds.")
)
View Source
var ImageExtensions []string

Functions

func ExtensionMatch

func ExtensionMatch(p string, extensions []string) bool

func ListArchives

func ListArchives(dir string) (anames []string, err error)

func LoadPixbuf

func LoadPixbuf(r io.Reader, autorotate bool) (*gdk.Pixbuf, error)

Types

type Archive

type Archive interface {
	Load(i int, autorotate bool) (*gdk.Pixbuf, error)
	Name(i int) (string, error)
	Len() int
	Close() error
}

func NewArchive

func NewArchive(path string) (Archive, error)

type Buffer

type Buffer struct {
	bytes.Buffer
}

func NewBuffer

func NewBuffer(data []byte) *Buffer

func (*Buffer) Seek

func (b *Buffer) Seek(offset int64, whence int) (int64, error)

func (*Buffer) SetSize

func (b *Buffer) SetSize(int64) error

func (*Buffer) Size

func (b *Buffer) Size() (int64, error)

type Dir

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

func NewDir

func NewDir(path string) (*Dir, error)

Reads filenames from a directory, and sorts them

func (*Dir) Close

func (d *Dir) Close() error

func (*Dir) Len

func (d *Dir) Len() int

func (*Dir) Load

func (d *Dir) Load(i int, autorotate bool) (*gdk.Pixbuf, error)

func (*Dir) Name

func (d *Dir) Name(i int) (string, error)

type File

type File struct {
	*os.File
}

func NewFile

func NewFile(f *os.File) *File

func (*File) Ext

func (r *File) Ext() string

func (*File) SetSize

func (r *File) SetSize(n int64) error

func (*File) Size

func (r *File) Size() (int64, error)

type Loader

type Loader interface {
	Load(i int) (*gdk.Pixbuf, error)
	Name(i int) (string, error)
	Len() int
}

type Zip

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

func NewZip

func NewZip(name string) (*Zip, error)

Reads filenames from a given zip archive, and sorts them

func (*Zip) Close

func (ar *Zip) Close() error

func (*Zip) Len

func (ar *Zip) Len() int

func (*Zip) Load

func (ar *Zip) Load(i int, autorotate bool) (*gdk.Pixbuf, error)

func (*Zip) Name

func (ar *Zip) Name(i int) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL