fileserver

package
v0.0.0-...-baa2ac4 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadFileHandler

func DownloadFileHandler(root string, w http.ResponseWriter, r *http.Request)

func GetDownloadFileHandler

func GetDownloadFileHandler(root string) func(w http.ResponseWriter, r *http.Request)

func GetReadFileHandler

func GetReadFileHandler(root string) func(w http.ResponseWriter, r *http.Request)

func GetRemoveFileHandler

func GetRemoveFileHandler(root string) func(w http.ResponseWriter, r *http.Request)

func GetScanDirHandler

func GetScanDirHandler(root string) func(w http.ResponseWriter, r *http.Request)

func GetWriteFileHandler

func GetWriteFileHandler(root string) func(w http.ResponseWriter, r *http.Request)

func ReadFileHandler

func ReadFileHandler(root string, w http.ResponseWriter, r *http.Request)

func RemoveFileHandler

func RemoveFileHandler(root string, w http.ResponseWriter, r *http.Request)

func ScanDirHandler

func ScanDirHandler(root string, w http.ResponseWriter, r *http.Request)

func WriteFileHandler

func WriteFileHandler(root string, w http.ResponseWriter, r *http.Request)

Types

type FileContent

type FileContent struct {
	Name    string `json:"name"`
	Ext     string `json:"ext"`
	Type    string `json:"type"`
	Content []byte `json:"content"`
}

type FileInfo

type FileInfo struct {
	Name    string    `json:"name"`
	Size    int64     `json:"size"`
	Type    string    `json:"type"`
	ModTime time.Time `json:"mtime"`
	IsDir   bool      `json:"isDir"`
}

func ScanDir

func ScanDir(p string, excludePatterns []string) ([]FileInfo, error)

type QueryUrl

type QueryUrl struct {
	Url url.Values `json:"url"`
}

func New

func New(url url.Values) *QueryUrl

func (*QueryUrl) Str

func (query *QueryUrl) Str(key string) (string, bool)

Jump to

Keyboard shortcuts

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