assets

package
Version: v0.0.0-...-105f9cb Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

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 FileDataJSON = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x97\x4b\x6f\xe3\x36\x14\x85\xd7\xf6\xaf\x10\xb4\x36\x67\xf4\xa0\x24\x2a\x80\x81\x0e\x8a\xb6\xab\xa2\x83\x6e\x8b\x59\x50\x7c\xd8\x2c\x24\xd1\xa3\x47\x1a\x23\xc8\x7f\x2f\xae\x1e\x8e\x65\x5d\x27\xb2\x1b\x4c\x77\x33\xd4\xfd\x78\x98\x9c\x7b\xc8\x9b\xe7\xf5\xca\x95\x62\xab\x9e\x78\x71\xc8\xd5\x46\x8a\xad\xad\x76\xee\x83\xf3\xfc\xb2\x59\xaf\x5c\x51\x6e\xb9\x2c\x4c\xb9\x41\x4b\xd6\xab\x95\xdb\xd6\xaa\x3a\xf0\xba\xfe\xc7\x56\xd2\x7d\x70\xdc\xae\xdc\x5d\xaf\x5e\x36\xeb\xf5\xca\xb5\xed\x16\x0a\x6a\x9c\x3f\x49\xe4\x99\xaa\x9a\xcd\xdb\xc5\x20\x66\xb3\xbf\x95\x68\x44\xce\xeb\xda\x7d\x70\xfe\x72\x4d\xa9\x9a\x3f\xaa\xdd\x57\x55\xd5\xb6\x74\x37\x8e\x7b\x78\xfd\x97\xad\xcd\xd3\x17\x21\x6c\x5b\x36\xee\xb7\x4d\x77\x54\xd3\x9f\xb0\x53\x73\x37\xd8\xe9\x2b\x95\xf3\xc6\x3c\x9a\xe6\xd8\x7f\x2f\xb8\xc9\x61\x5d\x99\xb2\x6e\x94\x29\x7f\x1a\xce\xf5\x09\x0e\x75\xaa\xe0\x52\x9a\xc6\xd8\x92\xe7\xdd\xa9\x7a\x81\x69\xa9\xe3\x72\x35\x59\xe9\x8f\x24\xca\xcb\x13\xd5\xdd\xca\x2f\x83\x5e\xbf\xb6\x33\x8f\xaa\x2c\x79\xa1\xe0\xd3\x97\xb3\x62\x69\xea\x43\xce\x8f\xe3\xa7\xaf\x95\xd5\x9f\x9c\xbe\xc0\x99\x6e\xd1\x0e\x3f\xfc\xf3\x5e\x3d\xbd\xa8\x44\x88\x50\x04\x8a\xa6\x2c\xa3\x41\x2a\xb3\xc8\x4f\x43\xc5\xc3\xd0\xe3\x5a\xc4\xbe\xec\x11\x55\x36\xd5\x71\xe4\x46\x84\x00\x43\x00\x22\x40\x91\x39\xd6\x7b\xb4\xbb\x5d\x4f\xb4\x75\x63\x8b\x0b\x3d\x77\x74\xae\x6c\x8b\x4c\x55\xee\x83\xe3\x7b\x9e\xe7\x0f\xbf\x96\xd7\xd5\xe0\xb4\x0a\xbf\x8c\x61\x8f\xeb\xa6\x29\xc0\xac\x06\xbb\xd6\xab\xce\x87\x6d\xcd\x4d\x6e\xca\x1d\xc9\xed\x23\xf4\xa0\x6d\xb7\xbb\xca\xb6\x07\xac\x1b\x37\x23\xf3\x68\x6c\x6e\x4a\xb2\xe7\xcd\x62\xe4\xb0\x3f\xd6\x46\xd4\x4b\x64\xd6\xab\x55\xdf\x25\x7b\x5b\x28\x69\x2a\x25\x1a\x5b\x1d\xe1\x27\xfb\x0c\x2b\x9f\x87\xb6\xe9\xb2\xd6\xed\x5d\xf0\xca\xa8\x1f\x15\xa3\x4e\xec\x4a\x8a\xb8\x34\x96\x8b\xc6\x3c\x5e\xe6\x48\xb4\x95\x51\x73\x3f\xfa\x18\x9c\xed\xd8\xa7\xe0\xe7\xf6\xb4\x30\x89\xc0\xef\xaf\x85\x68\x02\xba\xef\xce\x19\x8d\x84\xb4\x13\xbb\xcc\x68\x21\x90\x8c\x4e\xa2\x23\x12\x8f\xe9\x58\xea\x48\x86\x94\x66\x9c\xa6\x61\x18\xf2\x28\x51\x94\x2a\xa5\x45\x80\x45\x67\x44\x08\x30\x04\x20\x02\x14\x99\x63\x48\x74\x96\xe9\x4d\xa2\x33\x22\x78\x74\x82\x45\xd1\xb9\xe2\x13\x96\x1b\x30\xbb\x2d\x6e\x8a\xcd\xc1\xe6\xb6\xbc\x19\xfa\xb8\xe0\xf4\x8d\xf6\x9a\x9b\xca\x88\x3d\xaf\xe4\x8f\x4a\xce\x20\x87\x67\xa7\x6e\x0f\xaa\xd2\x79\x6b\xe4\xec\x11\xd2\xea\x58\x16\x1c\xb9\xce\xfa\xf8\x4c\xb6\xed\x03\xf4\x6b\x4f\x20\x11\xfa\xf3\xbc\x18\x0d\xd1\x50\xe1\x4c\xf6\x40\x82\x34\xc8\x5e\x46\xa9\xd2\xef\x45\x49\xdf\x1e\x25\xfd\x5f\xa2\xb4\x4c\x6f\x12\x25\xfd\x66\x94\xc2\x45\x51\xba\xea\x1a\x16\xa6\xef\x2d\x2f\x9b\x9b\x83\x61\x72\x5b\xdb\xc3\xfe\xf8\x7f\x3d\x44\x63\xe7\x9d\x4d\x7d\x57\xf7\x3a\x1b\xfb\x6e\x38\xc1\x95\xf8\x75\xf5\xa7\xb0\xfd\xd6\xfd\xef\x7c\xb0\x9a\x2a\x20\x0d\x25\x3d\x19\x25\xb1\xca\x88\x4e\xb8\x20\x34\x52\x01\x61\x2a\x4e\x09\x0f\xb8\xaf\xbc\x24\x8d\xa2\x38\x43\x06\xa8\x11\x03\x0a\x20\x60\xe6\x08\xd2\x83\xcb\xc0\x49\x0f\x8e\x88\xfb\x46\xb7\xb5\xa5\xf9\xde\xaa\xbe\xa1\xce\xdb\xe9\xfd\xc1\xfa\xd4\x0e\xef\xce\x0e\xa7\xca\x05\xb7\x25\x34\xcc\xeb\xf5\x7a\xc3\x64\x75\xa7\xcf\x53\x05\xc4\xe7\xc8\xf7\xd2\x34\x62\x09\xf1\x64\x42\x09\x8d\x62\x46\x58\x10\x33\x22\x92\x8c\x27\x5e\x18\xa5\x5a\x07\x88\xcf\x23\x06\x14\x40\xc0\xcc\x11\xc4\xe7\x65\xe0\xc4\xe7\x11\xc1\x7d\x0e\x50\x9f\x97\x79\x7c\x66\xc5\xf2\x81\xf5\x4e\x27\x26\x02\x88\x11\x89\x47\x23\xe1\xb3\x8c\x78\x3a\x66\x84\x52\xa6\x49\x96\xf9\x11\xfc\x59\x21\xfc\x54\x6b\x9e\xa5\x1c\x31\x62\xc4\x80\x02\x08\x98\x39\x82\x18\xb1\x0c\x9c\x18\x31\x22\xb8\x11\xe1\xc7\x18\xb1\x7c\x6a\xba\xd3\x88\x89\x00\xf6\x94\x32\x91\x86\x91\x96\x84\xa5\x7e\x46\x68\xa6\x03\xc2\xb9\x9f\x12\x2d\x78\xc4\x04\x8b\x98\xf4\xb0\x9b\x6f\xc4\x80\x02\x08\x98\x39\x82\xbd\xbe\x8b\xc0\xe9\xeb\x3b\x20\xb8\x11\xf4\xaa\x11\xef\x5e\x65\xdf\xd6\x8e\xe3\x38\xa7\x67\xe8\x86\x69\xf4\xde\x77\x68\x2a\x81\xd8\xe1\x7b\x5e\x14\x26\x2c\x20\x9c\x51\x9f\x50\xc6\x43\xc2\x58\x9a\x10\x2e\x78\x96\xa6\xa1\xe4\x99\x94\x88\x1d\x23\x06\x14\x40\xc0\xcc\x11\xc4\x8e\x65\xe0\xc4\x8e\x11\xc1\xed\x88\x3e\xca\x8e\x1b\x46\xa0\x3b\xdd\x98\x2a\x60\x97\x14\x65\xdc\xe3\xdc\x27\x11\x17\x09\xa1\x61\x18\x13\xa6\x13\x4d\xb8\x8a\x7d\x5f\x06\x89\xa4\xbe\xc6\x2e\xa9\x01\x03\x0a\x20\x60\xe6\x08\x76\x49\x2d\x02\xa7\x97\xd4\x80\xe0\x66\xc4\x57\xcd\x58\xf0\x78\x5f\xa4\xe3\xa6\xe9\xf2\xee\x39\xed\x42\x04\x1d\xd5\x22\xc5\xb4\xcc\x48\xa8\x02\x4d\xa8\x66\x3e\xbc\x1c\x8a\xf8\x4a\xc5\x01\xf5\x34\x93\x21\x43\x47\xb5\x1e\x03\x0a\x20\x60\xe6\x08\x3a\xaa\x2d\x01\x2f\x46\xb5\x1e\xc1\x4d\x49\x3e\xc0\x94\xf5\xcb\xfa\xdf\x00\x00\x00\xff\xff\xdd\x06\x7a\xf9\xb1\x15\x00\x00")

FileDataJSON is "data.json"

Functions

func New

func New(opts ...Option) http.FileSystem

New returns a new http filesystem to serve assets.

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

type Option

type Option func(o *Options)

Option defines a single option function.

func Config

func Config(val *config.Config) Option

Config provides a function to set the config option.

func Logger

func Logger(val log.Logger) Option

Logger provides a function to set the logger option.

type Options

type Options struct {
	Logger log.Logger
	Config *config.Config
}

Options defines the available options for this package.

Jump to

Keyboard shortcuts

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