archive

package
v0.0.0-...-396bdb9 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxArchiveEntries = 4096 * 64
)

Variables

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

Functions

func ListInDirectory

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

Types

type Archive

type Archive interface {
	Load(i int, autorotate bool, nPreload int) (*gdk.Pixbuf, error)
	Kind() Kind
	ArchiveName() string
	Name(i int) (string, error)
	Len() *int // nil represents unknown length
	Close() error
}

func NewArchive

func NewArchive(path string, pageCache *pagecache.PageCache, httpReferer 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) ArchiveName

func (ar *Dir) ArchiveName() string

func (*Dir) Close

func (ar *Dir) Close() error

func (*Dir) Kind

func (ar *Dir) Kind() Kind

func (*Dir) Len

func (ar *Dir) Len() *int

func (*Dir) Load

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

func (*Dir) Name

func (ar *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 HTTP

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

func NewHTTP

func NewHTTP(url string, pageCache *pagecache.PageCache, referer string) (*HTTP, error)

func (*HTTP) ArchiveName

func (ar *HTTP) ArchiveName() string

func (*HTTP) Close

func (ar *HTTP) Close() error

func (*HTTP) Kind

func (ar *HTTP) Kind() Kind

func (*HTTP) Len

func (ar *HTTP) Len() *int

func (*HTTP) Load

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

func (*HTTP) Name

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

type Kind

type Kind = int
const (
	Packed Kind = iota
	Unpacked
	HTTPKind
)

type Loader

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

type Rar

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

func NewRar

func NewRar(name string) (*Rar, error)

NewRar reads supported image filenames from a given rar archive and sorts them

func (*Rar) ArchiveName

func (ar *Rar) ArchiveName() string

func (*Rar) Close

func (ar *Rar) Close() error

func (*Rar) Kind

func (ar *Rar) Kind() Kind

func (*Rar) Len

func (ar *Rar) Len() *int

func (*Rar) Load

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

func (*Rar) Name

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

type RarMember

type RarMember struct {
	Header *rardecode.FileHeader
	Offset int // in terms of files
}

type RarMembers

type RarMembers []RarMember

func (RarMembers) Len

func (p RarMembers) Len() int

func (RarMembers) Less

func (p RarMembers) Less(i, j int) bool

func (RarMembers) Swap

func (p RarMembers) Swap(i, j int)

type Zip

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

func NewZip

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

NewZip reads filenames from a given zip archive and sorts them

func (*Zip) ArchiveName

func (ar *Zip) ArchiveName() string

func (*Zip) Close

func (ar *Zip) Close() error

func (*Zip) Kind

func (ar *Zip) Kind() Kind

func (*Zip) Len

func (ar *Zip) Len() *int

func (*Zip) Load

func (ar *Zip) Load(i int, autorotate bool, _nPreload int) (*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