embedfshttp

package module
v0.0.0-...-c914fbf Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 4 Imported by: 0

README

go-embedfs-http

License

go-embedfs-http is a super small http.FileSystem that serves files from an embedded filesystem (designed for go 1.16' embed feature), while also disabling directory listings and strips the path prefix.

I outsourced this into a separate module, because I use it in multiple projects.

Installation

Add it to your go.mod like every other module:

go get github.com/d0x7/go-embedfs-http

License

MIT © 2023 Dorian Heinrichs

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(fs embed.FS, path string) http.Handler

Types

type NonIndexingFileSystem

type NonIndexingFileSystem struct {
	// contains filtered or unexported fields
}

func (NonIndexingFileSystem) Open

func (fs NonIndexingFileSystem) Open(name string) (http.File, error)

Jump to

Keyboard shortcuts

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