fileserver

package module
v0.0.0-...-2d5a06f Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirAddName

func DirAddName(dir, name string) (relatePath string, err error)

DirAddName implements FileSystem using os.Stat, checking files for reading rooted and relative to the directory dir.

func RequestName

func RequestName(prefix string, r *http.Request) (name string)

RequestName returns a string name that serves HTTP requests by removing the given prefix from the request URL's Path and invoking the request r. The name is '/'-separated.

func RootPath

func RootPath(dir string) (rootPaths, rootPathName []string)

RootPath traverse all root path for giving dir.

Types

type Module

type Module struct {
	Path string
}

Module contain http file server module.

func (*Module) Compress

func (s *Module) Compress(w http.ResponseWriter, r *http.Request)

Compress module will zip the specified path.

type ReRender

type ReRender struct {
	HandlePattern string
	FileServerDir string
}

ReRender will re-render Body with http.FileServer

func (*ReRender) ServeHTTP

func (fsrd *ReRender) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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