Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdaptToHTTPFileSystem ¶
func AdaptToHTTPFileSystem(fs FileSystem, directoryListings bool) http.FileSystem
AdaptToHTTPFileSystem converts any FileSystem implementation into one that can be used with http.FileServer
Types ¶
type ByteTransformer ¶
type ByteTransformer = func(original []byte)
type FileSystem ¶
type FileSystem interface {
MkdirAll(dirPath string, perm os.FileMode) error
Create(name string) (WriteableFile, error)
Remove(name string) error
Stat(name string) (os.FileInfo, error)
IsNotExist(err error) bool
Open(path string) (ReadableFile, error)
}
FileSystem is an abstract file read/write interface
func LocalFileSystem ¶
func LocalFileSystem(dir string) FileSystem
LocalFileSystem provides access to things in a local directory
func TransformFileSystem ¶
func TransformFileSystem(fs FileSystem, transformer ByteTransformer) FileSystem
type ReadableFile ¶
type ReadableFile interface {
io.ReadCloser
io.Seeker
Readdir(count int) ([]os.FileInfo, error)
Stat() (os.FileInfo, error)
}
ReadableFile is a file that we can read data from
type SPAFileSystem ¶
type SPAFileSystem struct {
// contains filtered or unexported fields
}
SPAFileSystem responds with the given fallback file if the requested path does not exist.
func CreateSPAFileSystem ¶
func CreateSPAFileSystem(fs http.FileSystem, fallback string) SPAFileSystem
CreateSPAFileSystem that falls back to `fallback`
type WriteableFile ¶
type WriteableFile interface {
io.WriteCloser
}
WriteableFile is a file that we can write data to
Click to show internal directories.
Click to hide internal directories.