webfs

package
v0.0.0-...-f34a01f Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2019 License: BSD-2-Clause-Views Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FsMap

type FsMap = map[string]func(string) Webfs

FsMap maps strings to correct fs constructors

type Server

type Server struct {
	Wfs Webfs
}

Server is a struct to allow Webfs to be used with net/http

func (Server) Serve9P

func (fs Server) Serve9P(s *styx.Session)

func (Server) ServeHTTP

func (fs Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Webfs

type Webfs interface {
	Read(requestFile string) (io.ReadSeeker, error)
	Stat(path string) (os.FileInfo, error)
}

Webfs defines a simple interface to be used for serving web pages

func NewWebfs

func NewWebfs(path string, fsmap FsMap) (Webfs, error)

NewWebfs creates a new webfs using the ConfigTranslator

Jump to

Keyboard shortcuts

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