Files
opencloud/pkg/assets/embed.go
2020-04-21 21:10:21 +02:00

281 lines
13 KiB
Go

// Code generated by fileb0x at "2020-04-21 21:09:33.242683 +0200 CEST m=+0.003837269" from config file "embed.yml" DO NOT EDIT.
// modification hash(f63be23a1d0af58f2fbee0850affb860.f981a36dcc1205c4270f67885fe56dea)
package assets
import (
"bytes"
"compress/gzip"
"context"
"io"
"net/http"
"os"
"path"
"golang.org/x/net/webdav"
)
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)
)
// HTTPFS implements http.FileSystem
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
}
// FileAppJs is "app.js"
var FileAppJs = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x51\xc1\x8a\xc2\x30\x10\xbd\xe7\x2b\xde\x61\x21\x17\xb1\xbb\x47\x03\x1e\xf6\xb0\x0b\x1e\xf6\xe4\x51\x04\x43\x3b\xd5\x40\x9b\x09\xc9\x54\x04\xe9\xbf\x2f\x4d\x5b\xb5\xe0\x2d\xf3\x26\xf3\xde\x9b\x37\xae\x0d\x1c\x05\x7b\x12\x71\xfe\x9c\xbe\x43\x40\x1d\xb9\x85\x5e\x17\x25\xb7\x81\x3d\x79\x49\xc5\x4b\x7b\x7d\xed\x48\xab\x69\x2c\x09\x47\x7a\x0c\xe4\x4a\x2b\x55\xb2\x4f\x02\x1b\xc2\xce\xd7\x8c\x2d\xee\x0a\xf0\xb6\x25\x03\x3d\x13\xe9\x95\x02\x5c\x65\xa0\xd3\x02\x29\xd9\x1b\xe8\x33\xd9\x38\xd6\xe9\xd7\x35\xf4\x53\x39\xe1\x68\x50\xdb\x26\xd1\x00\xd3\x4d\xc8\x27\xc7\x3e\x19\x1c\x8e\x03\x52\xb2\xaf\xdd\xd9\x64\x29\xa0\x8b\x8d\x81\xbe\x88\x04\x53\x14\x0d\x97\xb6\xb9\x70\x12\xb3\xf9\xda\x7c\x6a\x05\xf4\xaa\x9f\x4d\x46\xee\x84\x12\xb6\x38\x28\x4c\xc3\x93\xd3\x85\x2f\x20\x58\xb9\x18\xe8\x62\x2a\x9f\xd9\xcc\x9a\x18\x16\x36\xaf\x41\x66\xb8\xcf\x7a\xc7\x59\xcf\xdb\xeb\x4e\xa8\x7d\xab\xb8\x5f\x2a\x0e\x59\xfc\x59\xa1\xe8\x6c\x63\xe6\x34\xd7\x03\x3a\xf6\xb3\xf5\xa7\xfa\x7b\xdb\xb3\xf1\x53\xf1\x71\x7f\x50\x54\x7d\x71\x5a\x9a\xa3\x5b\x3e\x67\x45\xb5\xed\x1a\xc9\x9c\xd3\xef\x81\x26\xdf\x75\x78\x8c\x69\xad\xf2\x39\xc7\x3d\x54\xaf\xfe\x03\x00\x00\xff\xff\x23\x2f\x62\x64\x42\x02\x00\x00")
// FileClientSettingsIndexJs is "client/settings/index.js"
var FileClientSettingsIndexJs = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x57\x5f\x6f\xe3\x36\x0c\x7f\x0f\x90\xef\xc0\x01\xc5\x64\x27\x39\xfb\x9e\x3b\xf8\xba\xad\x2b\x86\x01\xdd\x16\x74\x2b\x86\xa1\x28\x7a\x6e\xcc\xa4\xba\xd8\x92\x23\x29\x6b\x83\x20\xdf\x7d\x90\xfc\x27\xb1\x2d\xa7\x5e\x9b\x1b\x96\xeb\xf2\x90\x38\x22\xf9\x23\x29\x91\xfc\xc9\xfe\x00\x50\xc6\x94\xa9\x77\x11\x95\xe1\x7d\x8c\x30\xf0\xfb\x3d\x9a\xa4\x5c\x28\x08\x9f\x28\x97\x30\x15\x3c\x01\x62\x9e\x49\x29\x5a\x14\xeb\x0b\xbd\x18\xa3\x82\x88\x27\x21\x65\x10\x00\x21\xfd\x1e\x3e\x19\xad\x09\x67\x52\xc1\x0c\xd5\x0f\x85\xd0\x71\x21\xf8\x00\xeb\x7e\x0f\x40\xa0\x5a\x0a\x96\xdb\xf5\x7b\x9b\x9a\x95\xdc\xb5\x3a\xc9\xb4\xb6\xc6\xa5\xb7\x93\x36\x7b\x81\x8b\x25\x4a\xa5\xad\x13\x54\x0f\x3c\x1a\xc1\x52\xc4\x23\xb8\xe7\xd1\x6a\x04\x8b\x25\x8a\xd5\x38\x14\x61\x82\x0a\x85\x1c\xc1\x94\x8b\x64\xa4\x4d\xa7\x74\xb6\x75\x93\x59\x42\x90\x3f\x78\x8a\x5f\xf2\x47\x14\xe7\xa1\x44\xc7\xd5\x0a\x3a\xf3\x39\xae\x24\x04\xf0\xeb\xfd\x27\x9c\x28\x4f\xff\x73\x6a\xf0\xa5\xaa\x59\xbf\x16\x31\x04\x3a\x18\xbd\x4a\xa7\xe0\x68\x13\x2f\x46\x36\x53\x0f\xf0\x01\xde\xbb\x99\x6f\xa8\x69\xc3\x10\xc8\x19\x81\x21\x2c\xa4\x27\x95\xa0\x6c\x46\xa7\x2b\xab\xa7\x8d\xfe\xf2\x7d\x8b\xc7\x61\xdd\x17\x9c\xe5\xa0\x99\x20\x09\x53\xfd\xa0\xf3\xd7\x3f\x43\x20\x81\x16\x22\x9b\xf0\x08\xaf\xaf\x7e\x3a\xe7\x49\xca\x19\x32\x55\xf7\x7b\x33\xc7\xd5\xad\xeb\x7a\x9f\x38\x65\x0e\xf9\x9a\xb8\x2e\x9c\x02\x21\x6e\x91\xa2\xde\xf5\x32\xaf\xfc\xe4\x4d\x49\xdd\x64\x3b\x7b\xeb\x14\x81\x16\x27\x94\x1f\x85\xc9\x07\x30\x96\x68\x70\x8a\x03\x09\x02\x20\x33\x54\xa4\x2b\x66\x13\xad\x9b\x5d\x65\xaf\x75\x8d\xb8\x55\x2c\x53\x77\xfe\x20\x78\xf1\xa7\xdf\x83\x01\x58\x3e\xfd\x1e\xbc\x1c\x54\xf7\xb0\x3f\x18\x18\x6c\xf3\x95\x37\xc3\x29\x5c\x52\xa9\x7e\x43\xa5\x28\x9b\xc9\xef\x97\x2c\x8a\x51\x1a\x85\xa5\x88\xad\xc2\xeb\xab\x4b\x23\xcf\x76\xc6\xaa\x72\xf7\xfb\x9f\xe3\x8b\xcc\x4b\xf8\x78\xd7\x06\x74\x77\xf5\xdd\x1f\x77\x05\xda\xb7\xa9\x2e\x1c\xc0\x27\x85\x4c\x52\xce\xe0\x9d\x09\xd3\xaf\xb5\xb0\x05\x06\x02\x98\x2e\xd9\x44\x51\xce\x9c\xb4\xac\x3e\x08\x60\xbd\xc9\x4b\x21\x33\x2d\xe7\xc3\x56\xc9\xcb\x47\x05\x9c\xd9\x16\x4f\xb7\x63\x2a\xeb\xec\x0c\x27\x3b\xeb\x1a\x4e\xb6\x58\xf4\x74\x1a\xaa\x07\x3d\xf6\xfc\x30\xa5\xfe\x5f\xef\xfd\xfb\x2c\x52\x52\xc8\x75\x39\x57\xfa\x7f\x5c\x8d\xbb\x90\xe9\xea\x2a\x17\x74\xad\x6f\x5d\xde\x90\x72\xab\xc8\x2d\x7c\x15\x04\xb0\x64\x11\x4e\x29\xc3\xa8\x3a\x2c\xc6\x2d\x26\xbb\xf1\x57\x24\xe5\xb8\xa8\x3a\xf4\x4e\xea\x73\xa5\x70\xb3\x3b\xe5\xf6\xe9\x7b\x53\x2e\x2e\xc2\xc9\x83\xd3\x3c\xae\x5f\xc2\x04\x4b\xbc\x66\xe0\x15\xbd\xdb\xda\xd6\xef\x57\xce\x20\x37\xee\x37\x65\x5a\x79\x7b\xe7\xf5\xef\x98\x99\x31\x2a\xaa\x63\x68\xce\xae\x1b\x25\x34\x09\x66\x4f\x91\xef\x56\xa9\x5b\x61\x3b\x4b\x95\x74\xc1\xd5\x2d\xb6\x07\x54\x67\xd5\x09\xa8\x16\x9b\xbd\x83\xf6\x15\xea\xa1\xba\xeb\xb9\xc6\xf9\xbf\xfe\x5f\x53\xff\x65\x56\xff\xe0\x7a\x52\xb9\x8e\xe5\xad\x51\xde\x0b\xfe\xcd\x0b\xc3\xa6\x8d\xbb\xce\x05\x86\x0a\xab\x15\xbd\x25\x2f\x9b\xb4\xce\x5e\x36\x1d\x0b\x7d\x59\xd5\x2c\xfc\xa5\xe7\x46\x0b\x75\xd9\x20\xde\x2a\x77\x69\x90\xd6\xb6\x35\x7b\x58\x6d\xcf\x4c\xbf\xa5\x33\x4b\xb8\xc0\x0a\x97\x57\xf1\x58\xf0\x84\x4a\xf4\x04\xea\xa2\x77\x18\x3e\xc2\x85\x10\x5c\x38\xe4\x67\x2a\x25\x65\x33\x53\x55\x54\x60\x04\x5b\xd7\xa7\x26\x18\xe2\xba\x5f\xe6\x50\x68\x27\xc5\x94\xcb\x83\xb1\xe2\xbe\xde\x79\x15\x2d\xb6\xf6\xee\x1e\x54\x93\x58\x37\xa8\x23\x65\xc6\x23\xaf\xc9\x2f\x93\xa8\x7e\x44\xd5\xc6\x52\x0d\x51\x9d\xa2\x1a\x0a\x16\x7e\x6a\xea\x74\x78\xb9\x2a\xd6\x75\xf6\x76\xce\x6a\xc0\x1e\x0f\x61\xf9\xeb\x32\xdd\x8d\xbf\x9e\xe3\x6a\xf3\x3a\x0a\xcb\xdd\xe8\x1f\x4f\x60\x1a\x87\x13\x74\xc8\x8e\x0f\x32\x82\x8f\x27\xeb\x96\x3b\xe5\xe6\xa3\xfb\xdc\x15\xf6\x73\x90\xd7\x16\x7f\x87\xc1\xec\x89\x98\x0d\x6a\xa4\x30\xc7\x55\x6b\xf0\x46\xf6\x59\xc2\xd6\xc8\x6f\x8f\x72\x0f\xf8\x1e\xda\x3a\x0d\xba\xd3\xad\xb5\x7d\x9e\xf7\xf3\xa2\xb7\x52\xdb\x04\xfc\xcf\x33\x6f\xcb\x7c\x39\xc4\x98\x38\x4c\x87\x1e\x79\xa3\x1c\xf7\x3d\xe0\xef\x00\x00\x00\xff\xff\x3d\x0a\xc9\xdc\x45\x19\x00\x00")
// FileComponentsSettingsAppVue is "components/SettingsApp.vue"
var FileComponentsSettingsAppVue = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x91\xcf\x8a\xb3\x30\x14\xc5\xf7\x79\x8a\x4b\x37\x2a\xd4\xc8\xb7\x6d\xad\xd0\x6f\x33\x0f\xd0\xe5\x30\x0b\x49\xae\x1a\x26\xff\x30\x37\x22\x14\xdf\x7d\xd0\xa6\xed\x4c\xe9\xea\xde\x8b\xe7\xfc\x3c\x87\xd4\x84\xc6\xeb\x96\xb0\x61\x00\xb5\x54\x13\x08\xdd\x86\x70\xda\xc5\xef\xb2\xd3\x38\x43\x9a\xa5\x70\x3a\x1a\xfb\x38\x8d\x92\x52\xe3\x7a\x9a\x76\xec\x95\x2d\x67\xdd\x8e\x3d\x96\xe4\xfc\x6e\x45\x01\xd4\xc3\xbf\xdb\x02\x70\x41\x22\x65\xfb\x00\x01\xc7\x49\x09\xe4\x9c\xdf\x24\xd5\x4d\x53\x57\x52\x4d\x0d\xab\xab\x67\x18\x56\x07\x31\x2a\x4f\x0d\x53\xc6\xbb\x91\xe0\x0a\xa6\xf5\x67\x41\xca\xd9\xb0\x5f\xf7\x0f\x24\xc2\x31\xc0\x02\xdd\xe8\x0c\x64\x53\xc4\x39\x3b\x32\x9c\x37\xb9\xc4\xae\x8d\x9a\xe0\xca\x00\x6c\x6b\xf0\x00\xd9\x3d\xc5\xd9\xfb\x6c\xcf\x00\x84\x33\x3e\x12\xca\xc3\x26\x02\xe0\x9c\x3f\xb1\xf9\x35\x65\x0f\xc9\xf5\x3f\x5a\xa9\x31\xfc\xe2\x54\x2f\x9f\xb2\xcd\xb1\x14\x0c\x60\x59\xf9\x06\x69\x70\x32\xfc\xc5\xa7\x06\xf9\x83\x92\xed\xe1\x33\xfd\x2a\xeb\x90\xc4\x70\x79\x47\xfd\x7a\x52\x5d\xb4\x84\x12\xf2\x22\x71\x69\x50\x81\xbf\x73\xe6\x05\xa7\x01\x6d\x9e\x17\x70\x6a\xe0\xde\x47\x38\x1b\x9c\x46\xae\x5d\x9f\x6f\xd6\x97\x16\xc5\x31\xd5\x58\xe7\xc2\x16\x56\x57\xf7\x97\xf8\x09\x00\x00\xff\xff\x3b\x62\x86\x7e\x2c\x02\x00\x00")
// FileStoreIndexJs is "store/index.js"
var FileStoreIndexJs = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x53\xc1\x6a\xe3\x30\x10\xbd\xeb\x2b\xde\x61\x41\x2e\x18\xb7\xec\xd1\xe0\x85\x6d\x9b\x96\x42\x36\x3d\x24\x7b\x5a\x96\xa0\xb5\x27\x8e\x40\x96\x82\x35\xa6\x2d\xc1\xff\xbe\xd8\xb2\x95\xd6\xe4\x24\x31\xf3\xde\x9b\xa7\x99\x91\x6e\x4e\xae\x65\x9c\xb1\xd6\x9e\xb7\xc4\xac\x6d\xed\xef\x3b\x5b\x19\xf2\xe8\x71\x68\x5d\x03\x99\x65\xb7\xa5\xd1\x64\xf9\xd6\x4f\x08\x29\x44\xe9\xac\x67\x78\x56\x4c\x28\x70\x16\x40\xe9\xec\x41\xd7\x39\x6c\x67\x4c\x2a\x00\xff\x55\x2e\xc7\x9f\xbf\xa2\x9f\x89\x35\x31\x53\xeb\x17\xd4\x49\xee\x47\xb8\x64\x21\x7c\x55\x6b\x81\x5c\xe4\x2f\x75\x9a\x8e\x15\x6b\x67\xe7\x4a\xdb\xd5\x6e\xbf\x5d\xed\x76\x2f\x9b\xe7\xed\xfe\xfe\xf7\xe6\x71\xbd\xda\x22\x19\x45\x52\x9c\xd4\x87\x71\xaa\xba\x19\x91\xb8\x2e\x8d\x62\x86\x09\xa0\x4f\x85\x00\xd6\xaf\x3f\x1f\xf7\x0f\xaf\x9b\xa7\x97\xe7\x28\x15\xac\x7f\x55\x0a\x31\x14\x53\x72\xe0\x5f\x8c\xaa\xf2\xb3\xcd\x41\xff\x21\xc0\x93\x33\x4a\xd7\x34\x9a\xd1\x2f\x65\x43\x3c\x91\x9f\x0c\xc8\x88\x89\xf6\x94\xff\xb0\x25\x0e\xc4\xe5\x71\x39\xe1\xa8\x9d\xa2\xd2\xfe\xa4\xb8\x3c\xa6\x71\x34\xfd\xa5\xcc\x60\xb0\x25\x7f\x72\xd6\x0f\xd3\x56\x6f\x4a\xf3\xb5\x95\x49\x02\x01\xf8\x56\xb9\x46\x69\x9b\xcf\x62\xd3\xdb\xb3\xae\x35\x23\xa2\xbf\x19\x0f\x7d\x40\x32\xeb\x66\x43\x93\x3a\x8f\xa2\x28\xf0\xfd\xee\x6e\x2e\x1e\xca\x3b\x43\x99\x71\xf5\x05\x5c\x29\x56\x37\x11\x10\xda\x70\x6d\xb6\x32\xc5\x15\x4e\x0f\x32\x9e\x62\x85\xf9\xed\x89\xf4\x47\xf7\xf6\x8b\xbc\x57\x35\xc9\x34\xe6\x01\xd6\x6c\x28\x87\x7c\x52\xda\x50\x05\x76\xa1\x9f\x71\x2f\xf1\x2f\x34\x20\x93\x69\xe4\x54\xe4\xcb\x1c\x8b\xe7\xed\xe8\x9d\x2f\x90\x10\xcb\x21\x2b\x65\x6b\x6a\xe5\x94\xe8\x53\x9c\xd1\x3a\xc7\x39\xb8\xed\x68\xee\x56\x3f\x6f\x0c\xbd\x8f\xbf\xb6\xa2\x83\xea\x0c\x8f\x36\xad\x6a\xc8\x9f\x54\x49\x55\xe0\x8c\x9f\x66\x5c\x45\x81\x79\x08\xc3\x75\x5a\xb3\xe1\x1a\xbf\x86\xe8\xc5\xff\x00\x00\x00\xff\xff\x7f\xe5\xdf\x9e\x08\x04\x00\x00")
func init() {
err := CTX.Err()
if err != nil {
panic(err)
}
err = FS.Mkdir(CTX, "components/", 0777)
if err != nil && err != os.ErrExist {
panic(err)
}
err = FS.Mkdir(CTX, "client/", 0777)
if err != nil && err != os.ErrExist {
panic(err)
}
err = FS.Mkdir(CTX, "client/settings/", 0777)
if err != nil && err != os.ErrExist {
panic(err)
}
err = FS.Mkdir(CTX, "store/", 0777)
if err != nil && err != os.ErrExist {
panic(err)
}
var f webdav.File
var rb *bytes.Reader
var r *gzip.Reader
rb = bytes.NewReader(FileAppJs)
r, err = gzip.NewReader(rb)
if err != nil {
panic(err)
}
err = r.Close()
if err != nil {
panic(err)
}
f, err = FS.OpenFile(CTX, "app.js", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0777)
if err != nil {
panic(err)
}
_, err = io.Copy(f, r)
if err != nil {
panic(err)
}
err = f.Close()
if err != nil {
panic(err)
}
rb = bytes.NewReader(FileClientSettingsIndexJs)
r, err = gzip.NewReader(rb)
if err != nil {
panic(err)
}
err = r.Close()
if err != nil {
panic(err)
}
f, err = FS.OpenFile(CTX, "client/settings/index.js", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0777)
if err != nil {
panic(err)
}
_, err = io.Copy(f, r)
if err != nil {
panic(err)
}
err = f.Close()
if err != nil {
panic(err)
}
rb = bytes.NewReader(FileComponentsSettingsAppVue)
r, err = gzip.NewReader(rb)
if err != nil {
panic(err)
}
err = r.Close()
if err != nil {
panic(err)
}
f, err = FS.OpenFile(CTX, "components/SettingsApp.vue", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0777)
if err != nil {
panic(err)
}
_, err = io.Copy(f, r)
if err != nil {
panic(err)
}
err = f.Close()
if err != nil {
panic(err)
}
rb = bytes.NewReader(FileStoreIndexJs)
r, err = gzip.NewReader(rb)
if err != nil {
panic(err)
}
err = r.Close()
if err != nil {
panic(err)
}
f, err = FS.OpenFile(CTX, "store/index.js", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0777)
if err != nil {
panic(err)
}
_, err = io.Copy(f, r)
if err != nil {
panic(err)
}
err = f.Close()
if err != nil {
panic(err)
}
Handler = &webdav.Handler{
FileSystem: FS,
LockSystem: webdav.NewMemLS(),
}
}
// Open a file
func (hfs *HTTPFS) Open(path string) (http.File, error) {
path = hfs.Prefix + path
f, err := FS.OpenFile(CTX, path, os.O_RDONLY, 0644)
if err != nil {
return nil, err
}
return f, nil
}
// ReadFile is adapTed from ioutil
func ReadFile(path string) ([]byte, error) {
f, err := FS.OpenFile(CTX, path, os.O_RDONLY, 0644)
if err != nil {
return nil, err
}
buf := bytes.NewBuffer(make([]byte, 0, bytes.MinRead))
// If the buffer overflows, we will get bytes.ErrTooLarge.
// Return that as an error. Any other panic remains.
defer func() {
e := recover()
if e == nil {
return
}
if panicErr, ok := e.(error); ok && panicErr == bytes.ErrTooLarge {
err = panicErr
} else {
panic(e)
}
}()
_, err = buf.ReadFrom(f)
return buf.Bytes(), err
}
// WriteFile is adapTed from ioutil
func WriteFile(filename string, data []byte, perm os.FileMode) error {
f, err := FS.OpenFile(CTX, filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm)
if err != nil {
return err
}
n, err := f.Write(data)
if err == nil && n < len(data) {
err = io.ErrShortWrite
}
if err1 := f.Close(); err == nil {
err = err1
}
return err
}
// 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 WalkDirs(name string, includeDirsInList bool, files ...string) ([]string, error) {
f, err := FS.OpenFile(CTX, name, os.O_RDONLY, 0)
if err != nil {
return nil, err
}
fileInfos, err := f.Readdir(0)
if err != nil {
return nil, err
}
err = f.Close()
if err != nil {
return nil, err
}
for _, info := range fileInfos {
filename := path.Join(name, info.Name())
if includeDirsInList || !info.IsDir() {
files = append(files, filename)
}
if info.IsDir() {
files, err = WalkDirs(filename, includeDirsInList, files...)
if err != nil {
return nil, err
}
}
}
return files, nil
}