Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CTX is a context for webdav vfs
	CTX = context.Background()

	// FS is a virtual memory file system
	FS = webdav.NewMemFS()

	// Handler is used to server files through a http handler
	Handler *webdav.Handler

	// HTTP is the http file system
	HTTP http.FileSystem = new(HTTPFS)
)
View Source
var FilePkgHTML = []byte("\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x68\x74\x6d\x6c\x3e\x0a\x3c\x68\x74\x6d\x6c\x3e\x0a\x20\x20\x20\x20\x3c\x68\x65\x61\x64\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x6d\x65\x74\x61\x20\x6e\x61\x6d\x65\x3d\x22\x67\x6f\x2d\x69\x6d\x70\x6f\x72\x74\x22\x20\x63\x6f\x6e\x74\x65\x6e\x74\x3d\x22\x7b\x7b\x20\x2e\x43\x61\x6e\x6f\x6e\x69\x63\x61\x6c\x20\x7d\x7d\x20\x67\x69\x74\x20\x68\x74\x74\x70\x73\x3a\x2f\x2f\x7b\x7b\x20\x2e\x53\x6f\x75\x72\x63\x65\x20\x7d\x7d\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x6d\x65\x74\x61\x20\x6e\x61\x6d\x65\x3d\x22\x67\x6f\x2d\x73\x6f\x75\x72\x63\x65\x22\x20\x63\x6f\x6e\x74\x65\x6e\x74\x3d\x22\x7b\x7b\x20\x2e\x43\x61\x6e\x6f\x6e\x69\x63\x61\x6c\x20\x7d\x7d\x20\x68\x74\x74\x70\x73\x3a\x2f\x2f\x7b\x7b\x20\x2e\x53\x6f\x75\x72\x63\x65\x20\x7d\x7d\x20\x68\x74\x74\x70\x73\x3a\x2f\x2f\x7b\x7b\x20\x2e\x53\x6f\x75\x72\x63\x65\x20\x7d\x7d\x2f\x74\x72\x65\x65\x2f\x6d\x61\x73\x74\x65\x72\x7b\x2f\x64\x69\x72\x7d\x20\x68\x74\x74\x70\x73\x3a\x2f\x2f\x7b\x7b\x20\x2e\x53\x6f\x75\x72\x63\x65\x20\x7d\x7d\x2f\x74\x72\x65\x65\x2f\x6d\x61\x73\x74\x65\x72\x7b\x2f\x64\x69\x72\x7d\x2f\x7b\x66\x69\x6c\x65\x7d\x23\x4c\x7b\x6c\x69\x6e\x65\x7d\x22\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x3c\x6d\x65\x74\x61\x20\x68\x74\x74\x70\x2d\x65\x71\x75\x69\x76\x3d\x22\x72\x65\x66\x72\x65\x73\x68\x22\x20\x63\x6f\x6e\x74\x65\x6e\x74\x3d\x22\x30\x3b\x20\x75\x72\x6c\x3d\x68\x74\x74\x70\x73\x3a\x2f\x2f\x7b\x7b\x20\x2e\x53\x6f\x75\x72\x63\x65\x20\x7d\x7d\x22\x3e\x0a\x20\x20\x20\x20\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x20\x20\x20\x20\x3c\x62\x6f\x64\x79\x3e\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x4e\x6f\x74\x68\x69\x6e\x67\x20\x74\x6f\x20\x73\x65\x65\x20\x68\x65\x72\x65\x2e\x20\x50\x6c\x65\x61\x73\x65\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\x22\x68\x74\x74\x70\x73\x3a\x2f\x2f\x7b\x7b\x20\x2e\x53\x6f\x75\x72\x63\x65\x20\x7d\x7d\x22\x3e\x6d\x6f\x76\x65\x20\x61\x6c\x6f\x6e\x67\x3c\x2f\x61\x3e\x2e\x0a\x20\x20\x20\x20\x3c\x2f\x62\x6f\x64\x79\x3e\x0a\x3c\x2f\x68\x74\x6d\x6c\x3e\x0a")

FilePkgHTML is "pkg.html"

Functions

func ReadFile

func ReadFile(path string) ([]byte, error)

ReadFile is adapTed from ioutil

func WalkDirs

func WalkDirs(name string, includeDirsInList bool, files ...string) ([]string, error)

WalkDirs looks for files in the given dir and returns a list of files in it usage for all files in the b0x: WalkDirs("", false)

func WriteFile

func WriteFile(filename string, data []byte, perm os.FileMode) error

WriteFile is adapTed from ioutil

Types

type HTTPFS

type HTTPFS struct {
	// Prefix allows to limit the path of all requests. F.e. a prefix "css" would allow only calls to /css/*
	Prefix string
}

HTTPFS implements http.FileSystem

func (*HTTPFS) Open

func (hfs *HTTPFS) Open(path string) (http.File, error)

Open a file

Source Files