asset

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssetHandler

func AssetHandler(prefix string, assets embed.FS, root string) http.Handler

AssetHandler returns an http.Handler that will serve files from the Assets embed.FS. When locating a file, it will strip the given prefix from the request and prepend the root to the filesystem.

func RegisterAsset

func RegisterAsset(router *gin.Engine)

Types

type NotFoundRedirectRespWr

type NotFoundRedirectRespWr struct {
	http.ResponseWriter // We embed http.ResponseWriter
	// contains filtered or unexported fields
}

自定义FileServer

func (*NotFoundRedirectRespWr) Write

func (w *NotFoundRedirectRespWr) Write(p []byte) (int, error)

func (*NotFoundRedirectRespWr) WriteHeader

func (w *NotFoundRedirectRespWr) WriteHeader(status int)

Jump to

Keyboard shortcuts

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