Help us shape the future of Go! Take the 2026 Go Developer Survey

billyhttp

package
v0.57.27 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BillyFs

type BillyFs interface {
	billy.Basic
	billy.Dir
}

BillyFs is the set of required billy filesystem interfaces.

type Dir

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

Dir implements the HTTP directory.

func NewDir

func NewDir(fs BillyFs, path string) *Dir

NewDir constructs the Dir from a Billy Dir.

func (*Dir) Close

func (f *Dir) Close() error

Close releases nothing because Dir holds no open handles.

func (*Dir) Read

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

Read returns an error because a directory has no contents to read.

func (*Dir) Readdir

func (f *Dir) Readdir(count int) ([]fs.FileInfo, error)

Readdir reads the directory contents following the os.File contract.

With count > 0 it returns at most count entries, continuing after the entries returned by earlier calls, and io.EOF once none remain. With count <= 0 it returns all remaining entries and a nil error.

func (*Dir) Seek

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

Seek returns an error because a directory has no contents to seek.

func (*Dir) Stat

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

Stat returns the directory metadata.

type File

type File struct {
	// File is the billy file
	billy.File
	// contains filtered or unexported fields
}

File implements the HTTP file.

func NewFile

func NewFile(fs BillyFs, path string) (*File, error)

NewFile constructs the File from a Billy File.

func (*File) Readdir

func (f *File) Readdir(count int) ([]fs.FileInfo, error)

Readdir returns an error because a file has no directory entries.

func (*File) Stat

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

Stat returns the file metadata.

type FileSystem

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

FileSystem implements the HTTP filesystem.

func NewFileSystem

func NewFileSystem(fs BillyFs, prefix string) *FileSystem

NewFileSystem constructs the FileSystem from a Billy FileSystem.

Prefix is a path prefix to prepend to file paths for HTTP. The prefix is trimmed from the paths when opening files.

func (*FileSystem) Open

func (f *FileSystem) Open(name string) (http.File, error)

Open opens the file at the given path.

Jump to

Keyboard shortcuts

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