...

Package static

import "github.com/gin-contrib/static"
Overview
Index

Overview ▾

Constants

const INDEX = "index.html"

func LocalFile

func LocalFile(root string, indexes bool) *localFileSystem

func Serve

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

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

func ServeRoot

func ServeRoot(urlPrefix, root string) gin.HandlerFunc

type ServeFileSystem

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