justlog/api/assets_vfsgen.go

201 lines
372 KiB
Go
Raw Normal View History

2020-01-26 12:58:59 +01:00
// Code generated by vfsgen; DO NOT EDIT.
package api
import (
"bytes"
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
pathpkg "path"
"time"
)
// assets statically implements the virtual filesystem provided to vfsgen.
var assets = func() http.FileSystem {
fs := vfsgen۰FS{
"/": &vfsgen۰DirInfo{
name: "/",
2020-09-05 12:15:35 +02:00
modTime: time.Date(2020, 9, 5, 10, 0, 18, 102057447, time.UTC),
2020-08-30 11:42:09 +02:00
},
2020-09-05 12:15:35 +02:00
"/bundle.22ebb6fd5601faad229a.js": &vfsgen۰CompressedFileInfo{
name: "bundle.22ebb6fd5601faad229a.js",
2020-09-05 12:28:49 +02:00
modTime: time.Date(2020, 9, 5, 10, 28, 33, 713922437, time.UTC),
2020-09-05 11:33:17 +02:00
uncompressedSize: 315726,
compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xfd\xfd\x72\xdb\xb8\xb6\x28\x88\xff\xdf\x4f\x41\xf1\x9e\xad\x06\x22\x48\x11\xe5\x8f\x38\x94\x61\xed\xee\x24\xfd\xdb\xb9\xb7\xd3\x49\x25\xe9\xb3\x7f\x67\xb4\x75\x5d\xb4\x04\xd9\xec\xd0\x80\x0e\x08\xd9\xf1\x36\x75\xde\x6c\x6a\x1e\x69\x5e\x61\x0a\x9f\x04\x48\xca\x76\xd2\xfb\xd6\xad\x9a\x9a\xaa\x54\x2c\x92\xf8\x58\x00\x16\x16\x16\xd6\x67\x6f\xbd\xa5\x4b\x91\x33\x0a\x08\xbc\xbf\xc9\x78\x24\xf0\xfd\x6e\x6a\x5f\x46\x14\x70\x78\x9f\xaf\x81\x98\xf3\x05\xe4\x44\x6c\x39\x8d\xe4\xef\x11\xf9\xba\x61\x5c\x94\x53\x59\x85\x61\xf9\x0a\xdf\xe7\x29\x47\x45\xda\x4b\x90\xf9\x98\xde\xef\x76\x53\x53\x89\xc8\x4a\xcb\xac\x28\x00\xb3\x75\x11\x43\xf5\x6f\x0a\x11\x1b\x15\xb8\x37\xae\xdf\xed\xe8\xe8\x1a\x13\x44\x47\x4b\x2c\x10\x1d\xad\x70\x0d\x2a\x12\x88\xc3\x7b\x3a\x62\xf2\x27\xac\xaa\xf7\x17\x7f\x90\xa5\x18\xad\xc8\x3a\xa7\xe4\x03\x67\x1b\xc2\xc5\x9d\x2a\x76\x4f\xe8\xf6\x9a\xf0\xec\xa2\x20\x69\x6f\x8c\x2e\x89\x48\xf9\x0e\xee\x10\x1d\x71\xec\x0f\x3d\xde\x52\x5d\x7b\x15\xf7\xb0\xb8\xdb\x10\xb6\x8e\x3e\xdd\x5d\x5f\xb0\xa2\xdf\xd7\x7f\x47\x82\x7d\x12\x3c\xa7\x97\x9f\xb3\xcb\x7e\x7f\x5f\x8f\xed\xb2\xe8\xfe\x26\x2b\xb6\x24\x8d\xdf\xb1\xd5\xb6\x20\xf1\x0e\xa2\x7d\x95\xe3\xf3\x73\x52\x9a\x62\xb6\x5a\x6f\xac\xc1\x15\xc1\xf0\xd5\xa2\x24\x7d\xd1\xef\x03\x82\xe5\x00\x20\x3a\xe9\x0b\xbb\x42\x64\x9a\xaf\xc1\xa1\xfc\x1a\x33\xd5\x55\x8c\xed\x98\x48\xbf\x2f\xff\x8d\xea\x9e\xea\x4a\x72\x2d\x39\x36\xc0\x2d\x39\xc9\x04\x01\x74\x5b\x14\x50\x36\x47\x47\x1c\xf0\x7d\xa0\x73\x14\xaf\xc8\x3a\xdb\x16\x22\x6e\xce\xb8\x1e\x05\xd9\x41\x34\x51\x00\x95\x6a\x5e\xea\x49\x26\x70\xcd\x38\x50\x68\x14\xe5\x34\x22\x90\x8e\x56\x80\x23\x86\xdc\x70\x05\xbc\x77\x48\x24\x16\xbb\xd1\x45\x4e\x57\x0a\x2e\xc4\x20\xb4\xf8\xc5\xe5\x1c\x51\xdc\xc6\xe6\xc6\x68\x67\xae\x44\xdd\xea\xc8\xc0\xbe\x4b\x3b\x3e\x3a\x0c\x96\x70\x09\x14\x67\x31\x12\x10\x09\xd9\x1d\x6b\x2c\x89\x29\x68\xa6\x68\xc3\x99\x60\x72\x90\xa3\xab\xac\x7c\x7f\x4b\xed\x64\xe9\x5d\x20\x2b\xc8\x36\x36\x38\x7e\x1e\x23\x0a\xe8\xa8\xc4\xc7\x2f\xe1\x0e\xcc\x03\x2c\xa7\x12\x33\x4b\x12\xc9\x59\x5b\x8a\x78\x4a\xec\xe6\xc0\x14\x1c\x24\x70\x87\x9a\xa5\x83\x02\x47\x10\x34\x8a\xc0\xfb\xd8\x3e\xd6\x38\x11\xac\xf8\xac\x6e\x21\xac\xa8\x70\x6d\x54\x6e\x37\x84\x9f\x63\x81\x48\x3d\xc0\x06\xca\x78\x43\x47\xf7\x4b\x46\x4b\xc1\xb7\x4b\xc1\x78\x6a\x30\x9a\x20\x1f\x43\x12\x74\xcb\x73\x61\xb1\x65\xc9\xe8\x3a\xbf\xdc\x5a\xec\xd9\xed\x20\xdc\xa5\xfb\x20\x92\x74\x49\x8e\xd8\xc2\xa4\x10\xd8\xc3\x01\x78\xbf\x9b\x52\x0f\x4c\x1f\x30\x1f\x7c\x4a\x6e\x23\xea\xbf\x19\x79\x50\x63\xb2\xdb\xb5\xa7\x39\x58\x14\x47\x43\x23\x02\x14\x54\x5d\xc4\xe4\xfc\xfc\xe3\x9b\x9f\x5e\x7d\x3e\x7f\xfd\xe6\xdf\x3f\xbf\x7f\xff\xeb\xa7\xf3\xff\xdf\xaf\xef\x7f\xfe\xe9\xd7\xf3\xbf\xbd\x7f\xff\x3f\xce\xcf\xfb\xfd\x8e\x75\x79\xb8\xca\x68\x79\x45\x96\x5f\x5e\xbf\x7a\x03\xef\xc7\x53\xc1\xef\xee\x9f\x58\x1c\x10\xb8\x5b\x66\x62\x79\x25\xf7\x88\x1c\x28\x2b\xc8\x88\x70\xce\xb8\xfc\xb2\xdb\x01\x88\x02\x24\x9a\xb4\x50\x48\x4d\x33\xe2\x88\xe1\xba\xa0\x7f\x68\xe4\x00\xde\x8b\x2b\xce\x6e\x23\x39\xb3\x6f\x54\xd3\x71\x49\xc4\xe7\xfc\x9a\xb0\xad\x88\xae\xb2\x32\xa2\x4c\x44\x17\x84\xd0\xc8\x4e\x14\xdc\xb9\xfa\x59\x57\xfd\x65\x41\x32\xfe\xd4\x16\x0a\x39\x36\x49\xb4\x30\xc6\x75\xc7\x96\xd2\xd5\x6f\x00\x41\x63\x45\xdd\x54\xc9\xbc\xaa\x7a\x14\xf6\xfb\xed\x1a\xd4\x6b\x05\x35\xab\xcb\xb9\xb7\xe5\xd4\x1b\x33\xbd\x72\xcf\x78\x9f\xf4\xbe\x57\x74\x2b\x2c\x14\x16\x10\x57\x79\xa9\x0b\xec\x76\x3d\x0f\x95\x65\x53\x14\x77\x60\x49\x0d\xce\xac\xfe\x99\xe6\xf5\x1a\x53\x9c\xef\x14\x20\x5d\xb5\xfd\x69\x9d\xf9\x0f\x69\x56\xb7\xc0\x71\x26\xf1\x42\xed\xaf\x2d\x2a\xf1\x7c\x81\x96\xb8\x97\xa0\x35\x1e\x26\xf5\xb2\x6f\x00\xbc\x5f\xf6\xfb\xdb\x7e\x1f\xa8\xaf\xdb\x51\x41\xe8\xa5\xb8\x9a\x95\x78\x2b\x77\xd4\x32\x13\xa0\x84\xa9\xac\x84\x4a\xf3\xad\xdf\x5f\x01\xe8\x2d\xdc\x4a\x6f\xa0\xde\x52\x63\x19\xc1\x05\xd8\xc0\xe9\x12\xf7\xc6\x53\x7b\x4c\x08\x6c\x2b\x4f\xc5\x14\xde\xcb\xd7\x5b\x5c\x2a\xa8\xa6\x83\xc1\xfa\x54\x4c\xe1\xb6\xdf\xdf\xce\xd7\x8b\x11\xdf\x52\x00\xa7\xaa\xc3\xba\xd6\x6e\x8b\xd5\x22\xe8\x11\x78\xe7\x45\xbe\x06\x1c\x63\xec\x4f\x82\x5d\x7f\xff\x1d\x20\x1a\x63\
2020-08-30 12:04:29 +02:00
},
2020-03-01 14:53:53 +01:00
"/favicon.ico": &vfsgen۰CompressedFileInfo{
name: "favicon.ico",
2020-08-06 17:13:52 +02:00
modTime: time.Date(2020, 8, 6, 15, 3, 40, 343374367, time.UTC),
2020-03-01 14:53:53 +01:00
uncompressedSize: 15086,
compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x9b\xe9\x6f\x54\x55\x18\xc6\x7f\x13\x68\xa9\x90\x68\x13\x0b\xb4\x54\xe9\x88\x56\xab\x56\xad\x90\x0e\x0d\x58\x45\x51\x63\x22\xee\xb8\xd1\x16\xfd\x00\x68\xdc\xa8\x68\x11\xa1\x08\xa5\x0a\x68\x82\x46\x40\x62\x34\xee\x9a\xf0\x41\xa3\xd2\xb8\x45\x63\x5a\xf8\xe0\x7f\x41\x62\x62\xac\xfb\x92\xa0\xb6\x55\x19\xf3\xb6\xcf\x4d\x6e\x86\x39\xb7\x53\x66\x6e\xef\x8c\xdc\x27\x79\x72\xee\x9c\x73\xde\x39\xcf\x9c\xfb\xf6\x3d\x6b\x21\xc1\x14\x9a\x9a\x2c\x4d\xb2\xbf\x1e\x52\x40\x32\xa9\xcf\x95\x70\xb8\x1e\x2a\x2b\xc7\x3e\xdf\x3b\x15\xb6\xa7\xa0\x01\x68\x02\xee\x66\x2c\x7f\x14\x67\x11\x23\x46\x18\x98\x0f\xdc\x0e\xdc\x16\xc0\x85\x40\x9d\xb9\xae\xd2\x73\x80\x1b\x7d\xe5\x66\x7f\x6e\x44\xfa\xf7\x02\x69\xe0\x9f\x2c\xfc\x57\x7c\x13\x68\x03\x56\x02\x1d\xc0\xa3\xc0\x4f\xc0\x51\xd5\x33\xfb\x8d\x11\xe9\xdf\xa7\xf6\x83\xf8\x16\xd0\x0e\xdc\xa5\xdf\xd0\x05\xfc\x92\x51\x67\x53\x11\xeb\x7f\x5b\xfd\xee\xe9\x5f\x5f\x44\xfa\x9f\x07\x46\x80\x3f\x1d\xfc\x0b\x78\x15\xb8\x53\xef\x60\x05\xf0\x30\xf0\xad\xca\xac\xce\x30\xf0\x58\x44\xfa\xed\x6f\xf1\x4a\xe0\x0a\x07\x97\x02\xe7\x03\xd5\x40\x8d\xd2\xb9\xc0\xa5\x2a\xf3\xea\x24\x23\xd2\x1f\x23\x46\x3e\xb8\x00\xb8\x1e\xb8\x2e\x80\x17\x03\xa7\x01\xa7\x2b\x3d\x13\xb8\xc6\x57\x6e\xf6\xf5\x11\xe9\xdf\xa3\xf8\x37\xe2\xe0\xdf\xc0\xeb\x1a\xbf\x3a\x14\x83\x1e\x01\x7e\x50\xd9\x88\xc6\xb8\xc7\x23\xd2\x5f\xea\xf1\xbf\xd4\xf5\xef\xd6\xfb\x1f\x76\x70\x44\xfe\xb3\x42\xbf\xa1\x4d\xfe\xf3\xbd\xca\x86\x35\x07\xda\x10\x91\xfe\x46\x60\x19\x70\x6d\x00\x6d\x39\x54\xab\xbf\x5d\x4b\xe7\x01\x57\xfb\xca\x97\xc5\x2b\xa4\x18\x25\x0a\x5b\xee\x5f\xa5\x39\x9c\x8b\x8d\x9a\xbb\x79\xb4\x35\xd8\x12\x5f\xb9\xd9\x9f\x11\x91\xfe\xdd\x8a\x1f\x43\x0e\x5a\x7c\x79\x4d\xf1\xa7\x5d\xf1\x67\x1d\xf0\x9d\xca\x86\x34\x8e\x45\x15\x7f\x4a\x3d\xfe\x97\xba\xfe\xa0\xf5\xbb\xc7\x37\x7c\xeb\xf7\x76\xad\xdf\x7f\xd4\xb8\x17\xf5\xfa\xdd\xe6\x96\xcb\x81\x5b\x02\xd8\xac\x35\x57\x9d\xd2\xb3\x35\xef\xf4\xca\x97\x2b\x0e\xc4\x88\x51\x6a\xb0\xb5\x54\x2b\x70\x89\x83\xad\xda\xa3\x98\xe5\xa3\xcd\xe3\x5a\xc6\xb1\x0b\x8b\xad\xd2\xec\xe1\x39\x8d\x41\x47\x1c\xfc\x03\x78\x45\xfb\x3f\x6d\x1a\xc7\x3a\x81\x6f\x54\xe6\xb2\x0b\x8b\x43\xd2\xec\xa1\x50\xf1\x7f\x32\xb9\x6f\x82\xfa\x73\xd9\xff\x8c\x4a\xff\x0b\xca\x3b\xea\x60\xa6\xfe\x0e\xe9\xff\x79\x1c\xbb\xb0\x98\x96\x66\x0f\x29\xdf\xba\x30\x1b\x4d\xf7\x62\xcd\x2f\xe7\x89\xe7\x69\xdf\xbf\x3d\x02\xae\x94\xe6\x18\x31\x0a\x81\x3a\xf9\x53\x73\x00\xcd\xe7\x4f\x05\xaa\x94\x56\xeb\xdc\x2c\xc8\x26\x2c\xa6\xa4\xd9\xc3\x2e\x8d\x0b\xbf\x39\xf8\x3b\xf0\x92\xce\xe8\x6c\x0c\xbb\x03\x58\x0b\x7c\xad\x32\x97\x5d\x58\x3c\x22\xcd\x1e\xe2\xf1\xab\xf8\xf5\x17\x73\xff\xdb\xd8\xb4\x06\x58\x95\x85\xab\xc5\xcb\xb5\x3f\x58\x2f\x5e\xa8\xdf\xb1\xda\x61\x17\x26\xd7\x48\x73\x8c\x18\x79\x21\x3d\x0a\x77\xba\x75\x6e\x5d\x60\x3a\x9e\x7d\xf1\x7e\xcf\xe8\xc5\x28\x67\x3a\x59\xdf\xd3\xa0\x43\xf3\x25\xfe\x7b\x5a\x95\x51\x7b\x45\x51\xa2\x06\xe8\x06\x9e\xce\x60\xb7\x62\xe1\x7c\xdd\x47\xd8\x02\x3c\xa3\xbb\x14\x85\xec\xc9\x8b\x80\xc1\x2c\xe3\xc8\xa0\xe6\x42\x99\x63\xda\x61\x9d\x15\x4f\x66\xfb\x5d\x21\xb6\x3f\x4b\xed\x6c\xd2\x3e\xe9\x46\x3d\x3f\xa4\x39\x65\xa3\xf6\x63\xd6\xe9\x9d\xdc\x07\x9c\x5c\xc0\xf6\x4f\x74\x54\xcb\xbf\x7a\x81\x6d\x62\xaf\xf2\x5a\xe4\x1f\x8b\x75\x86\xff\xa4\xee\x17\x9d\x52\xc0\xf6\x4b\xc1\xff\xc3\x6c\x7f\xb6\xce\x0c\x7a\x80\xad\x62\x8f\xf2\x16\x4a\xdf\x22\x9d\x41\x6d\xd3\xfe\x5e\x21\xfb\xff\x44\xc7\x6c\xf5\x69\xb7\x8f\x9b\x95\xd7\xac\x3b\x3c\x2d\xba\x97\x60\xf9\x0f\x14\x38\xfe\x44\xed\x7f\x51\xb7\x5f\xa3\x98\xbf\x03\xd8\x2e\xee\x50\xbc\x59\xa4\x33\xac\x56\xf5\xfd\x4e\x8d\x45\xb1\xff\x17\x0e\x33\x35\xa6\xae\x57\xdf\x76\xe9\xd9\xf2\x16\xe8\x7e\x66\x0a\x78\x30\xa3\x4e\x3e\xf4\xbe\x7f\xe6\x71\xcc\x3f\x0a\xc5\x41\xb5\x1d\xd4\x7e\x67\x88\x7b\x0a\x5e\xfb\x73\x34\xb7\xdc\x95\xc1\x2d\xf2\xfb\x05\x9a\xc6\xf7\x66\xa9\x73\xbc\x7c\x56\xe3\xcc\x9c\xa8\x9d\xaf\x08\x50\xa5\xbd\x96\x4e\xf9\xdb\x5a\x3d\xaf\xd2\xdd\xae\x06\xbd\x83\x7b\x32\xea\xe4\xc3\x4e\xb5\x59\x95\x83\xff\x77\xfc\xcf\xfd\xbf\x16\x78\x4a\x77\x2d\xf6\x88\x7b\x95\x77\x99\xc6\xe0\xa5\x5a\x93\xf9\xeb\xe4\x43\xef\xfb\x6b\xa3\x76\xbe\xa8\x91\x16\x0e\xfd\x9a\
},
2020-01-26 12:58:59 +01:00
"/index.html": &vfsgen۰CompressedFileInfo{
name: "index.html",
2020-09-05 12:28:49 +02:00
modTime: time.Date(2020, 9, 5, 10, 28, 33, 713922437, time.UTC),
2020-09-05 12:15:35 +02:00
uncompressedSize: 380,
2020-01-26 12:58:59 +01:00
2020-09-05 12:15:35 +02:00
compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x54\x90\x51\x6b\xeb\x30\x0c\x85\xff\x8a\xaf\xef\x6b\x53\xdf\x06\x6e\xe9\xc0\xf6\x0f\xd8\xeb\x9e\xf6\xa8\xd8\x4a\xad\xcd\xb1\x82\xad\xa4\xf4\xdf\x8f\x34\xdb\xd8\x10\x08\x74\x0e\xe7\xe3\x20\xfb\x27\x72\x90\xfb\x8c\x2a\xc9\x94\xbd\xdd\xb6\xca\x50\xae\x4e\x63\xd1\xde\x26\x84\xe8\xed\x84\x02\x2a\x24\xa8\x0d\xc5\xe9\x45\xc6\xee\xa2\x3f\xd5\x02\x13\x3a\xbd\x12\xde\x66\xae\xa2\x55\xe0\x22\x58\xc4\xe9\x1b\x45\x49\x2e\xe2\x4a\x01\xbb\xc7\x71\xa0\x42\x42\x90\xbb\x16\x20\xa3\x3b\x1d\x5a\xaa\x54\xde\x3b\xe1\x6e\x24\x71\x85\x7f\x33\x25\xe1\x84\x5d\xe0\xcc\xf5\x07\xf6\x6f\x7f\xd9\x46\x7b\x2b\x24\x19\x7d\xe6\x6b\x43\xa8\x21\x59\xb3\x0b\xd6\xec\x9d\x07\x8e\x77\x6f\x0b\xb7\x50\x69\x16\xff\xca\x8b\x2a\x88\x51\x09\x2b\x2c\x30\x64\x54\xcf\xb0\xc2\xcb\xc3\xdd\xc4\xba\x14\x25\x89\x9a\x82\x79\x3e\x5a\xf3\x1d\xb4\x91\x56\x45\xd1\xe9\xca\x2c\xda\x5b\x13\x69\xf5\x76\x37\x55\xab\xc1\x69\x33\x2c\x25\x66\x3c\xf6\x3d\x0e\xc3\x79\x8c\xff\xcf\xff\x4e\x23\x40\xec\xfb\x27\x38\xbe\xb5\x2d\xf3\xc5\x32\x7b\x2b\xf3\x78\xf6\x47\x00\x00\x00\xff\xff\xfa\x9c\xd6\x45\x7c\x01\x00\x00"),
2020-01-26 12:58:59 +01:00
},
}
fs["/"].(*vfsgen۰DirInfo).entries = []os.FileInfo{
2020-09-05 12:15:35 +02:00
fs["/bundle.22ebb6fd5601faad229a.js"].(os.FileInfo),
2020-03-01 14:53:53 +01:00
fs["/favicon.ico"].(os.FileInfo),
2020-01-26 12:58:59 +01:00
fs["/index.html"].(os.FileInfo),
}
return fs
}()
type vfsgen۰FS map[string]interface{}
func (fs vfsgen۰FS) Open(path string) (http.File, error) {
path = pathpkg.Clean("/" + path)
f, ok := fs[path]
if !ok {
return nil, &os.PathError{Op: "open", Path: path, Err: os.ErrNotExist}
}
switch f := f.(type) {
case *vfsgen۰CompressedFileInfo:
gr, err := gzip.NewReader(bytes.NewReader(f.compressedContent))
if err != nil {
// This should never happen because we generate the gzip bytes such that they are always valid.
panic("unexpected error reading own gzip compressed bytes: " + err.Error())
}
return &vfsgen۰CompressedFile{
vfsgen۰CompressedFileInfo: f,
gr: gr,
}, nil
case *vfsgen۰DirInfo:
return &vfsgen۰Dir{
vfsgen۰DirInfo: f,
}, nil
default:
// This should never happen because we generate only the above types.
panic(fmt.Sprintf("unexpected type %T", f))
}
}
// vfsgen۰CompressedFileInfo is a static definition of a gzip compressed file.
type vfsgen۰CompressedFileInfo struct {
name string
modTime time.Time
compressedContent []byte
uncompressedSize int64
}
func (f *vfsgen۰CompressedFileInfo) Readdir(count int) ([]os.FileInfo, error) {
return nil, fmt.Errorf("cannot Readdir from file %s", f.name)
}
func (f *vfsgen۰CompressedFileInfo) Stat() (os.FileInfo, error) { return f, nil }
func (f *vfsgen۰CompressedFileInfo) GzipBytes() []byte {
return f.compressedContent
}
func (f *vfsgen۰CompressedFileInfo) Name() string { return f.name }
func (f *vfsgen۰CompressedFileInfo) Size() int64 { return f.uncompressedSize }
func (f *vfsgen۰CompressedFileInfo) Mode() os.FileMode { return 0444 }
func (f *vfsgen۰CompressedFileInfo) ModTime() time.Time { return f.modTime }
func (f *vfsgen۰CompressedFileInfo) IsDir() bool { return false }
func (f *vfsgen۰CompressedFileInfo) Sys() interface{} { return nil }
// vfsgen۰CompressedFile is an opened compressedFile instance.
type vfsgen۰CompressedFile struct {
*vfsgen۰CompressedFileInfo
gr *gzip.Reader
grPos int64 // Actual gr uncompressed position.
seekPos int64 // Seek uncompressed position.
}
func (f *vfsgen۰CompressedFile) Read(p []byte) (n int, err error) {
if f.grPos > f.seekPos {
// Rewind to beginning.
err = f.gr.Reset(bytes.NewReader(f.compressedContent))
if err != nil {
return 0, err
}
f.grPos = 0
}
if f.grPos < f.seekPos {
// Fast-forward.
_, err = io.CopyN(ioutil.Discard, f.gr, f.seekPos-f.grPos)
if err != nil {
return 0, err
}
f.grPos = f.seekPos
}
n, err = f.gr.Read(p)
f.grPos += int64(n)
f.seekPos = f.grPos
return n, err
}
func (f *vfsgen۰CompressedFile) Seek(offset int64, whence int) (int64, error) {
switch whence {
case io.SeekStart:
f.seekPos = 0 + offset
case io.SeekCurrent:
f.seekPos += offset
case io.SeekEnd:
f.seekPos = f.uncompressedSize + offset
default:
panic(fmt.Errorf("invalid whence value: %v", whence))
}
return f.seekPos, nil
}
func (f *vfsgen۰CompressedFile) Close() error {
return f.gr.Close()
}
// vfsgen۰DirInfo is a static definition of a directory.
type vfsgen۰DirInfo struct {
name string
modTime time.Time
entries []os.FileInfo
}
func (d *vfsgen۰DirInfo) Read([]byte) (int, error) {
return 0, fmt.Errorf("cannot Read from directory %s", d.name)
}
func (d *vfsgen۰DirInfo) Close() error { return nil }
func (d *vfsgen۰DirInfo) Stat() (os.FileInfo, error) { return d, nil }
func (d *vfsgen۰DirInfo) Name() string { return d.name }
func (d *vfsgen۰DirInfo) Size() int64 { return 0 }
func (d *vfsgen۰DirInfo) Mode() os.FileMode { return 0755 | os.ModeDir }
func (d *vfsgen۰DirInfo) ModTime() time.Time { return d.modTime }
func (d *vfsgen۰DirInfo) IsDir() bool { return true }
func (d *vfsgen۰DirInfo) Sys() interface{} { return nil }
// vfsgen۰Dir is an opened dir instance.
type vfsgen۰Dir struct {
*vfsgen۰DirInfo
pos int // Position within entries for Seek and Readdir.
}
func (d *vfsgen۰Dir) Seek(offset int64, whence int) (int64, error) {
if offset == 0 && whence == io.SeekStart {
d.pos = 0
return 0, nil
}
return 0, fmt.Errorf("unsupported Seek in directory %s", d.name)
}
func (d *vfsgen۰Dir) Readdir(count int) ([]os.FileInfo, error) {
if d.pos >= len(d.entries) && count > 0 {
return nil, io.EOF
}
if count <= 0 || count > len(d.entries)-d.pos {
count = len(d.entries) - d.pos
}
e := d.entries[d.pos : d.pos+count]
d.pos += count
return e, nil
}