PictureFS

package
v2.0.0-...-a0a7059 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: MIT Imports: 18 Imported by: 2

Documentation

Index

Constants

View Source
const VERSION = "0.1"

Variables

This section is empty.

Functions

func FileInfoToDirEntry

func FileInfoToDirEntry(info fs.FileInfo) fs.DirEntry

func ReadFile

func ReadFile(fsys fs.FS, name string) ([]byte, error)

func Sub

func Sub(fsys fs.FS, dir string) (fs.FS, error)

func ValidPath

func ValidPath(name string) bool

func WalkDir

func WalkDir(fsys fs.FS, root string, fn fs.WalkDirFunc) error

Types

type DirEntry

type DirEntry fileStat

func (*DirEntry) Info

func (de *DirEntry) Info() (fs.FileInfo, error)

func (*DirEntry) IsDir

func (de *DirEntry) IsDir() bool

func (*DirEntry) Name

func (de *DirEntry) Name() string

func (*DirEntry) Type

func (de *DirEntry) Type() fs.FileMode

type FS

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

func NewFS

func NewFS(img image.Image, layout Layout) (*FS, error)

func NewFSFile

func NewFSFile(img string, layout string) (*FS, error)

func (*FS) Open

func (pfs *FS) Open(name string) (fs.File, error)

func (*FS) ReadDir

func (pfs *FS) ReadDir(name string) ([]fs.DirEntry, error)

type File

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

func (*File) Close

func (f *File) Close() error

func (*File) Len

func (f *File) Len() int64

Len returns the number of bytes of the unread portion of the string.

func (*File) Read

func (f *File) Read(buf []byte) (n int, err error)

func (*File) ReadAt

func (f *File) ReadAt(b []byte, off int64) (n int, err error)

ReadAt implements the io.ReaderAt interface.

func (*File) ReadByte

func (f *File) ReadByte() (byte, error)

ReadByte implements the io.ByteReader interface.

func (*File) Seek

func (f *File) Seek(offset int64, whence int) (int64, error)

Seek implements the io.Seeker interface.

func (*File) Size

func (f *File) Size() int64

func (*File) Stat

func (f *File) Stat() (FileInfo, error)

type FileInfo

type FileInfo = fs.FileInfo

type FileMode

type FileMode = fs.FileMode

type Layout

type Layout struct {
	Version string
	Images  []Rect
}

type Rect

type Rect struct {
	Path          string
	X, Y          int
	Width, Height int
}

Jump to

Keyboard shortcuts

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