embedfs

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ErrInvalidSubDir errors.Msg = "invalid sub directory"

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS interface {
	fs.FS
	fs.ReadDirFS
	fs.ReadFileFS
}

type FileServer

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

func New

func New(embed FS, opts ...Option) (*FileServer, error)

func (*FileServer) ModTime

func (s *FileServer) ModTime() time.Time

func (*FileServer) ServeHTTP

func (s *FileServer) ServeHTTP(wri http.ResponseWriter, req *http.Request)

type Option

type Option func(f *FileServer) error

func WithModTime

func WithModTime(t time.Time) Option

func WithSubDir

func WithSubDir(dir string) Option

Jump to

Keyboard shortcuts

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