asarfs

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

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

Go to latest
Published: Jan 22, 2018 License: MIT Imports: 7 Imported by: 0

README

asarfilesystem

Serves HTTP static files from an asar electron archive.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASARfs

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

ASARfs serves the contents of an asar archive as an HTTP handler.

func New

func New(archivePath string, notFound http.Handler) (*ASARfs, error)

New creates a new ASARfs pointer based on the filepath to the archive and a HTTP handler to hit when a file is not found.

func (*ASARfs) Close

func (a *ASARfs) Close() error

Close closes the underlying file used for the asar archive.

func (*ASARfs) Open

func (a *ASARfs) Open(name string) (http.File, error)

Open satisfies the http.FileSystem interface for ASARfs.

func (*ASARfs) ServeHTTP

func (a *ASARfs) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP satisfies the http.Handler interface for ASARfs.

Jump to

Keyboard shortcuts

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