embed

package
v2.26.17+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Index: "index.html",
	FilePath: func(c echo.Context) (string, error) {
		return c.Param(`*`), nil
	},
}

Functions

func File

func File(fs FileSystems, configs ...Config) func(c echo.Context) error

File e.Get(`/*`, File(customFS))

Types

type Config

type Config struct {
	Index    string
	Prefix   string
	FilePath func(echo.Context) (string, error)
}

type FileSystems

type FileSystems []fs.FS

func NewFileSystems

func NewFileSystems() FileSystems

func (FileSystems) Glob

func (f FileSystems) Glob(pattern string) (matches []string, err error)

func (FileSystems) IsEmpty

func (f FileSystems) IsEmpty() bool

func (FileSystems) Open

func (f FileSystems) Open(name string) (file fs.File, err error)

func (FileSystems) ReadDir

func (f FileSystems) ReadDir(name string) (dirs []fs.DirEntry, err error)

func (FileSystems) ReadFile

func (f FileSystems) ReadFile(name string) (content []byte, err error)

func (*FileSystems) Register

func (f *FileSystems) Register(fileSystem fs.FS)

func (FileSystems) Size

func (f FileSystems) Size() int

func (FileSystems) Stat

func (f FileSystems) Stat(name string) (fi fs.FileInfo, err error)

func (FileSystems) Sub

func (f FileSystems) Sub(name string) (sub fs.FS, err error)

func (FileSystems) WalkDir

func (f FileSystems) WalkDir(name string, fn fs.WalkDirFunc) (err error)

Jump to

Keyboard shortcuts

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