filesystem

package
v0.0.0-...-51a7bb6 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package filesystem handles open files and folder directories. This implementation specifically disallows directory listings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileServer

func FileServer(r chi.Router, path string, root http.FileSystem)

FileServer serves the requested file

Types

type FileSystem

type FileSystem interface {
	Open(name string) (http.File, error)
}

FileSystem interface to allow access to local files

type Myfs

type Myfs struct {
	Dir http.Dir
}

Myfs is the accessible directory

func (Myfs) Open

func (m Myfs) Open(name string) (result http.File, err error)

Open returns the file if available. It will not return directory listings

Jump to

Keyboard shortcuts

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