bufferfs

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Overview

Package bufferfs provides a fs.FS wrapper for other fs.FS with a fs.File that implements io.Seeker and io.ReaderAt.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOutOfRange = errors.New("out of range")
)

Functions

This section is empty.

Types

type FS

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

FS implements a read-only meta file system where failing method calls to higher level file systems are passed to other file systems.

func New

func New(fsys fs.FS) *FS

New creates a new buffer FS.

func (*FS) Open

func (fsys *FS) Open(name string) (item fs.File, err error)

Open opens a file for reading.

type File

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

func (*File) Close

func (f *File) Close() (err error)

func (*File) Name

func (f *File) Name() string

func (*File) Read

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

func (*File) ReadAt

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

func (*File) ReadDir

func (f *File) ReadDir(count int) (fi []fs.DirEntry, err error)

func (*File) Seek

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

func (*File) Stat

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

Jump to

Keyboard shortcuts

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