static

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: MIT, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const INDEX = "index.html"

Variables

This section is empty.

Functions

func LocalFile

func LocalFile(root string, indexes bool) *localFileSystem

LocalFile 初始化本地文件系统 root 根路径 indexes

func Serve

func Serve(urlPrefix string, fs ServeFileSystem) gin.HandlerFunc

Static returns a middleware handler that serves static files in the given directory.

func ServerRoot

func ServerRoot(urlPrefix, root string) gin.HandlerFunc

返回一个以root为根目录的本地服务

Types

type ServeFileSystem

type ServeFileSystem interface {
	http.FileSystem
	Exists(prefix string, path string) bool
}

Jump to

Keyboard shortcuts

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