fs

package
v1.12.6 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 9 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download added in v1.12.6

func Download(destFile string, src http.File) (err error)

Download downloads from a http.File.

func File added in v1.12.3

func File(name string, r ContentReader) http.File

File implements a http.File by a ContentReader which may implement optional interface{ ModTime() time.Time } and io.Closer.

func Files

func Files(files ...string) http.FileSystem

Files implements a http.FileSystem by a list of file name and content file.

func FilesWithContent

func FilesWithContent(files ...string) http.FileSystem

FilesWithContent implements a http.FileSystem by a list of file name and content.

func Http added in v1.12.6

func Http(urlBase string) http.FileSystem

Http implements a http.FileSystem by http.Get join(urlBase, name).

func HttpFile added in v1.12.3

func HttpFile(name string, resp *http.Response) http.File

HttpFile implements a http.File by a http.Response object.

func HttpOpen added in v1.12.6

func HttpOpen(url string) (file http.File, err error)

HttpOpen opens a http.File from an url.

func Plugins added in v1.12.5

func Plugins(fs http.FileSystem, plugins ...interface{}) http.FileSystem

Plugins implements a filesystem with plugins by specified (ext string, plugin Opener) pairs.

func Root added in v1.12.1

func Root() http.FileSystem

Root implements a http.FileSystem that only have a root directory.

func SequenceFile added in v1.12.5

func SequenceFile(name string, body io.ReadCloser) http.File

SequenceFile implements a http.File by a io.ReadCloser object.

func Union

func Union(fs ...http.FileSystem) http.FileSystem

Union merge a list of http.FileSystem into a union http.FileSystem object.

func WithTracker added in v1.12.3

func WithTracker(fs http.FileSystem, urlBase string, exts ...string) http.FileSystem

WithTracker implements a http.FileSystem by pactching large file access like git lfs.

Types

type ContentReader added in v1.12.3

type ContentReader interface {
	io.Reader
	io.Seeker
	Size() int64
}

type Opener added in v1.12.5

type Opener = func(fs http.FileSystem, name string) (file http.File, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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