rge

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

README

rose-gin-embed

How to use

    router := gin.New()
	
    router.Use(rge.Serve("/", rge.Embed(web.UIStatic)))

Documentation

Index

Constants

View Source
const INDEX = "index.html"

Variables

This section is empty.

Functions

func LocalFile

func LocalFile(root string, indexes bool) *localFileSystem

func Serve

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

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

func ServeRoot

func ServeRoot(urlPrefix, root string) gin.HandlerFunc

Types

type ServeFileSystem

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

func Embed

func Embed(fsEmbed embed.FS) ServeFileSystem

func EmbedFolder

func EmbedFolder(fsEmbed embed.FS, targetPath string) ServeFileSystem

Jump to

Keyboard shortcuts

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