mirror of
https://github.com/mattermost/focalboard.git
synced 2024-12-27 13:48:52 +02:00
Fixing tests
This commit is contained in:
parent
dabfd2ea01
commit
20a223a091
@ -28,7 +28,7 @@ func getTestConfig() *config.Configuration {
|
||||
|
||||
func SetupTestHelper() *TestHelper {
|
||||
th := &TestHelper{}
|
||||
srv, err := server.New(getTestConfig())
|
||||
srv, err := server.New(getTestConfig(), true)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -147,7 +147,9 @@ func (s *Server) Shutdown() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if s.cleanUpSessionsTask != nil {
|
||||
s.cleanUpSessionsTask.Cancel()
|
||||
}
|
||||
|
||||
return s.store.Shutdown()
|
||||
}
|
||||
|
@ -153,8 +153,7 @@ func TestIsPasswordValidWithSettings(t *testing.T) {
|
||||
},
|
||||
} {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
as := New(tc.Settings)
|
||||
err := as.IsPasswordValid(tc.Password)
|
||||
err := IsPasswordValid(tc.Password, tc.Settings)
|
||||
if len(tc.ExpectedFailingCriterias) == 0 {
|
||||
assert.NoError(t, err)
|
||||
} else {
|
||||
|
@ -33,6 +33,20 @@ func (m *MockStore) EXPECT() *MockStoreMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// CleanUpSessions mocks base method
|
||||
func (m *MockStore) CleanUpSessions(arg0 int64) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "CleanUpSessions", arg0)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// CleanUpSessions indicates an expected call of CleanUpSessions
|
||||
func (mr *MockStoreMockRecorder) CleanUpSessions(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CleanUpSessions", reflect.TypeOf((*MockStore)(nil).CleanUpSessions), arg0)
|
||||
}
|
||||
|
||||
// CreateSession mocks base method
|
||||
func (m *MockStore) CreateSession(arg0 *model.Session) error {
|
||||
m.ctrl.T.Helper()
|
||||
@ -165,18 +179,18 @@ func (mr *MockStoreMockRecorder) GetParentID(arg0 interface{}) *gomock.Call {
|
||||
}
|
||||
|
||||
// GetSession mocks base method
|
||||
func (m *MockStore) GetSession(arg0 string) (*model.Session, error) {
|
||||
func (m *MockStore) GetSession(arg0 string, arg1 int64) (*model.Session, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetSession", arg0)
|
||||
ret := m.ctrl.Call(m, "GetSession", arg0, arg1)
|
||||
ret0, _ := ret[0].(*model.Session)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// GetSession indicates an expected call of GetSession
|
||||
func (mr *MockStoreMockRecorder) GetSession(arg0 interface{}) *gomock.Call {
|
||||
func (mr *MockStoreMockRecorder) GetSession(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSession", reflect.TypeOf((*MockStore)(nil).GetSession), arg0)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSession", reflect.TypeOf((*MockStore)(nil).GetSession), arg0, arg1)
|
||||
}
|
||||
|
||||
// GetSubTree2 mocks base method
|
||||
|
@ -1,11 +1,13 @@
|
||||
// Code generated by go-bindata. DO NOT EDIT.
|
||||
// sources:
|
||||
// templates/templates.json
|
||||
// templates/templates.json (22.926kB)
|
||||
|
||||
package initializations
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
@ -18,7 +20,7 @@ import (
|
||||
func bindataRead(data []byte, name string) ([]byte, error) {
|
||||
gz, err := gzip.NewReader(bytes.NewBuffer(data))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Read %q: %v", name, err)
|
||||
return nil, fmt.Errorf("read %q: %w", name, err)
|
||||
}
|
||||
|
||||
var buf bytes.Buffer
|
||||
@ -26,7 +28,7 @@ func bindataRead(data []byte, name string) ([]byte, error) {
|
||||
clErr := gz.Close()
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Read %q: %v", name, err)
|
||||
return nil, fmt.Errorf("read %q: %w", name, err)
|
||||
}
|
||||
if clErr != nil {
|
||||
return nil, err
|
||||
@ -38,6 +40,7 @@ func bindataRead(data []byte, name string) ([]byte, error) {
|
||||
type asset struct {
|
||||
bytes []byte
|
||||
info os.FileInfo
|
||||
digest [sha256.Size]byte
|
||||
}
|
||||
|
||||
type bindataFileInfo struct {
|
||||
@ -81,8 +84,8 @@ func templatesJson() (*asset, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "templates.json", size: 22926, mode: os.FileMode(420), modTime: time.Unix(1609798890, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
info := bindataFileInfo{name: "templates.json", size: 22926, mode: os.FileMode(0644), modTime: time.Unix(1610369786, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3, 0x15, 0x49, 0xe, 0xb2, 0xe7, 0x7, 0xd0, 0x6e, 0x35, 0x6f, 0xd0, 0x76, 0xe7, 0x1d, 0x9d, 0xc7, 0xa0, 0x55, 0x1, 0x25, 0x51, 0x9e, 0xd5, 0xf0, 0x81, 0x4c, 0x91, 0xd7, 0x33, 0x37, 0x3b}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
@ -90,8 +93,8 @@ func templatesJson() (*asset, error) {
|
||||
// It returns an error if the asset could not be found or
|
||||
// could not be loaded.
|
||||
func Asset(name string) ([]byte, error) {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[cannonicalName]; ok {
|
||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[canonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
|
||||
@ -101,6 +104,12 @@ func Asset(name string) ([]byte, error) {
|
||||
return nil, fmt.Errorf("Asset %s not found", name)
|
||||
}
|
||||
|
||||
// AssetString returns the asset contents as a string (instead of a []byte).
|
||||
func AssetString(name string) (string, error) {
|
||||
data, err := Asset(name)
|
||||
return string(data), err
|
||||
}
|
||||
|
||||
// MustAsset is like Asset but panics when Asset would return an error.
|
||||
// It simplifies safe initialization of global variables.
|
||||
func MustAsset(name string) []byte {
|
||||
@ -112,12 +121,18 @@ func MustAsset(name string) []byte {
|
||||
return a
|
||||
}
|
||||
|
||||
// MustAssetString is like AssetString but panics when Asset would return an
|
||||
// error. It simplifies safe initialization of global variables.
|
||||
func MustAssetString(name string) string {
|
||||
return string(MustAsset(name))
|
||||
}
|
||||
|
||||
// AssetInfo loads and returns the asset info for the given name.
|
||||
// It returns an error if the asset could not be found or
|
||||
// could not be loaded.
|
||||
func AssetInfo(name string) (os.FileInfo, error) {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[cannonicalName]; ok {
|
||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[canonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
|
||||
@ -127,6 +142,33 @@ func AssetInfo(name string) (os.FileInfo, error) {
|
||||
return nil, fmt.Errorf("AssetInfo %s not found", name)
|
||||
}
|
||||
|
||||
// AssetDigest returns the digest of the file with the given name. It returns an
|
||||
// error if the asset could not be found or the digest could not be loaded.
|
||||
func AssetDigest(name string) ([sha256.Size]byte, error) {
|
||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[canonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err)
|
||||
}
|
||||
return a.digest, nil
|
||||
}
|
||||
return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name)
|
||||
}
|
||||
|
||||
// Digests returns a map of all known files and their checksums.
|
||||
func Digests() (map[string][sha256.Size]byte, error) {
|
||||
mp := make(map[string][sha256.Size]byte, len(_bindata))
|
||||
for name := range _bindata {
|
||||
a, err := _bindata[name]()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
mp[name] = a.digest
|
||||
}
|
||||
return mp, nil
|
||||
}
|
||||
|
||||
// AssetNames returns the names of the assets.
|
||||
func AssetNames() []string {
|
||||
names := make([]string, 0, len(_bindata))
|
||||
@ -141,6 +183,9 @@ var _bindata = map[string]func() (*asset, error){
|
||||
"templates.json": templatesJson,
|
||||
}
|
||||
|
||||
// AssetDebug is true if the assets were built with the debug flag enabled.
|
||||
const AssetDebug = false
|
||||
|
||||
// AssetDir returns the file names below a certain
|
||||
// directory embedded in the file by go-bindata.
|
||||
// For example if you run go-bindata on data/... and data contains the
|
||||
@ -150,15 +195,15 @@ var _bindata = map[string]func() (*asset, error){
|
||||
// img/
|
||||
// a.png
|
||||
// b.png
|
||||
// then AssetDir("data") would return []string{"foo.txt", "img"}
|
||||
// AssetDir("data/img") would return []string{"a.png", "b.png"}
|
||||
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
|
||||
// then AssetDir("data") would return []string{"foo.txt", "img"},
|
||||
// AssetDir("data/img") would return []string{"a.png", "b.png"},
|
||||
// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and
|
||||
// AssetDir("") will return []string{"data"}.
|
||||
func AssetDir(name string) ([]string, error) {
|
||||
node := _bintree
|
||||
if len(name) != 0 {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
pathList := strings.Split(cannonicalName, "/")
|
||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
pathList := strings.Split(canonicalName, "/")
|
||||
for _, p := range pathList {
|
||||
node = node.Children[p]
|
||||
if node == nil {
|
||||
@ -180,11 +225,12 @@ type bintree struct {
|
||||
Func func() (*asset, error)
|
||||
Children map[string]*bintree
|
||||
}
|
||||
|
||||
var _bintree = &bintree{nil, map[string]*bintree{
|
||||
"templates.json": &bintree{templatesJson, map[string]*bintree{}},
|
||||
"templates.json": {templatesJson, map[string]*bintree{}},
|
||||
}}
|
||||
|
||||
// RestoreAsset restores an asset under the given directory
|
||||
// RestoreAsset restores an asset under the given directory.
|
||||
func RestoreAsset(dir, name string) error {
|
||||
data, err := Asset(name)
|
||||
if err != nil {
|
||||
@ -202,14 +248,10 @@ func RestoreAsset(dir, name string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
|
||||
}
|
||||
|
||||
// RestoreAssets restores an asset under the given directory recursively
|
||||
// RestoreAssets restores an asset under the given directory recursively.
|
||||
func RestoreAssets(dir, name string) error {
|
||||
children, err := AssetDir(name)
|
||||
// File
|
||||
@ -227,7 +269,6 @@ func RestoreAssets(dir, name string) error {
|
||||
}
|
||||
|
||||
func _filePath(dir, name string) string {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
|
||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...)
|
||||
}
|
||||
|
||||
|
@ -1,113 +1,321 @@
|
||||
// Code generated by go-bindata. DO NOT EDIT.
|
||||
// sources:
|
||||
// postgres_files/000001_init.down.sql (19B)
|
||||
// postgres_files/000001_init.up.sql (268B)
|
||||
// postgres_files/000002_system_settings_table.down.sql (28B)
|
||||
// postgres_files/000002_system_settings_table.up.sql (97B)
|
||||
// postgres_files/000003_blocks_rootid.down.sql (40B)
|
||||
// postgres_files/000003_blocks_rootid.up.sql (51B)
|
||||
// postgres_files/000004_auth_table.down.sql (39B)
|
||||
// postgres_files/000004_auth_table.up.sql (491B)
|
||||
|
||||
package postgres
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func bindata_read(data []byte, name string) ([]byte, error) {
|
||||
func bindataRead(data []byte, name string) ([]byte, error) {
|
||||
gz, err := gzip.NewReader(bytes.NewBuffer(data))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Read %q: %v", name, err)
|
||||
return nil, fmt.Errorf("read %q: %w", name, err)
|
||||
}
|
||||
|
||||
var buf bytes.Buffer
|
||||
_, err = io.Copy(&buf, gz)
|
||||
gz.Close()
|
||||
clErr := gz.Close()
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Read %q: %v", name, err)
|
||||
return nil, fmt.Errorf("read %q: %w", name, err)
|
||||
}
|
||||
if clErr != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
var __000001_init_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\x48\xca\xc9\x4f\xce\x2e\xb6\xe6\x02\x04\x00\x00\xff\xff\x45\xbe\x01\x0f\x13\x00\x00\x00")
|
||||
type asset struct {
|
||||
bytes []byte
|
||||
info os.FileInfo
|
||||
digest [sha256.Size]byte
|
||||
}
|
||||
|
||||
func _000001_init_down_sql() ([]byte, error) {
|
||||
return bindata_read(
|
||||
__000001_init_down_sql,
|
||||
type bindataFileInfo struct {
|
||||
name string
|
||||
size int64
|
||||
mode os.FileMode
|
||||
modTime time.Time
|
||||
}
|
||||
|
||||
func (fi bindataFileInfo) Name() string {
|
||||
return fi.name
|
||||
}
|
||||
func (fi bindataFileInfo) Size() int64 {
|
||||
return fi.size
|
||||
}
|
||||
func (fi bindataFileInfo) Mode() os.FileMode {
|
||||
return fi.mode
|
||||
}
|
||||
func (fi bindataFileInfo) ModTime() time.Time {
|
||||
return fi.modTime
|
||||
}
|
||||
func (fi bindataFileInfo) IsDir() bool {
|
||||
return false
|
||||
}
|
||||
func (fi bindataFileInfo) Sys() interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
var __000001_initDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\x48\xca\xc9\x4f\xce\x2e\xb6\xe6\x02\x04\x00\x00\xff\xff\x45\xbe\x01\x0f\x13\x00\x00\x00")
|
||||
|
||||
func _000001_initDownSqlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
__000001_initDownSql,
|
||||
"000001_init.down.sql",
|
||||
)
|
||||
}
|
||||
|
||||
var __000001_init_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x64\x8f\x31\x4f\xc3\x30\x10\x85\xe7\xf8\x57\xbc\x31\x91\xb2\x21\xb1\x30\xb9\xe5\x0a\x86\xc4\xa9\x9c\x2b\xb4\x2c\x55\x88\x0f\x61\x11\x4a\x14\x9b\x81\x7f\x8f\xda\x21\x43\xba\xdd\x7d\xba\xef\x9e\xde\xda\x91\x66\x02\xeb\x55\x45\x30\x1b\xd8\x86\x41\x7b\xd3\x72\x8b\xf7\xe1\xa7\xff\x8a\xc8\x55\x16\x3c\x5e\xb4\x5b\x3f\x6a\x97\xdf\xdc\x16\xa5\xca\xc2\x29\xca\x94\x8e\x5d\x02\x9b\x9a\x5a\xd6\xf5\x96\xdf\x2e\xae\xdd\x55\x15\xee\x69\xa3\x77\x15\xc3\x36\xaf\xf9\xf9\x7c\xec\x26\x39\xa5\xe3\xd5\x9b\xd8\x7f\xca\x77\x87\x95\x79\x30\x96\x4b\x95\xa5\xbf\x51\xc0\xb4\xbf\xcc\x21\x0d\xf3\xf2\x11\x64\xf0\x11\x4f\x6d\x63\x4b\x95\xf5\x93\x74\x49\xce\xe9\xb3\xf9\x3b\xfa\x25\xf2\x32\xc8\x02\x6d\x9d\xa9\xb5\x3b\xe0\x99\x0e\xc8\x83\x2f\x31\xf7\x28\x54\x71\xa7\xfe\x03\x00\x00\xff\xff\xa3\xc9\xa2\x70\x0c\x01\x00\x00")
|
||||
func _000001_initDownSql() (*asset, error) {
|
||||
bytes, err := _000001_initDownSqlBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func _000001_init_up_sql() ([]byte, error) {
|
||||
return bindata_read(
|
||||
__000001_init_up_sql,
|
||||
info := bindataFileInfo{name: "000001_init.down.sql", size: 19, mode: os.FileMode(0644), modTime: time.Unix(1602958996, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe4, 0x9a, 0x67, 0x49, 0xbf, 0xf7, 0xaa, 0x0, 0xe2, 0x48, 0xe4, 0xe2, 0xdc, 0x1, 0x8b, 0xa3, 0x24, 0x4, 0xcc, 0xbd, 0x3d, 0xbd, 0xf8, 0xec, 0xcf, 0x54, 0x9e, 0xc6, 0x83, 0x69, 0x7c, 0xb0}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var __000001_initUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x64\x8f\x31\x4f\xc3\x30\x10\x85\xe7\xf8\x57\xbc\x31\x91\xb2\x21\xb1\x30\xb9\xe5\x0a\x86\xc4\xa9\x9c\x2b\xb4\x2c\x55\x88\x0f\x61\x11\x4a\x14\x9b\x81\x7f\x8f\xda\x21\x43\xba\xdd\x7d\xba\xef\x9e\xde\xda\x91\x66\x02\xeb\x55\x45\x30\x1b\xd8\x86\x41\x7b\xd3\x72\x8b\xf7\xe1\xa7\xff\x8a\xc8\x55\x16\x3c\x5e\xb4\x5b\x3f\x6a\x97\xdf\xdc\x16\xa5\xca\xc2\x29\xca\x94\x8e\x5d\x02\x9b\x9a\x5a\xd6\xf5\x96\xdf\x2e\xae\xdd\x55\x15\xee\x69\xa3\x77\x15\xc3\x36\xaf\xf9\xf9\x7c\xec\x26\x39\xa5\xe3\xd5\x9b\xd8\x7f\xca\x77\x87\x95\x79\x30\x96\x4b\x95\xa5\xbf\x51\xc0\xb4\xbf\xcc\x21\x0d\xf3\xf2\x11\x64\xf0\x11\x4f\x6d\x63\x4b\x95\xf5\x93\x74\x49\xce\xe9\xb3\xf9\x3b\xfa\x25\xf2\x32\xc8\x02\x6d\x9d\xa9\xb5\x3b\xe0\x99\x0e\xc8\x83\x2f\x31\xf7\x28\x54\x71\xa7\xfe\x03\x00\x00\xff\xff\xa3\xc9\xa2\x70\x0c\x01\x00\x00")
|
||||
|
||||
func _000001_initUpSqlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
__000001_initUpSql,
|
||||
"000001_init.up.sql",
|
||||
)
|
||||
}
|
||||
|
||||
var __000002_system_settings_table_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\x28\xae\x2c\x2e\x49\xcd\x8d\x2f\x4e\x2d\x29\xc9\xcc\x4b\x2f\xb6\xe6\x02\x04\x00\x00\xff\xff\x8b\x60\xbf\x1e\x1c\x00\x00\x00")
|
||||
func _000001_initUpSql() (*asset, error) {
|
||||
bytes, err := _000001_initUpSqlBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func _000002_system_settings_table_down_sql() ([]byte, error) {
|
||||
return bindata_read(
|
||||
__000002_system_settings_table_down_sql,
|
||||
info := bindataFileInfo{name: "000001_init.up.sql", size: 268, mode: os.FileMode(0644), modTime: time.Unix(1603214842, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1d, 0xaf, 0xd8, 0x41, 0x91, 0x97, 0x98, 0xd, 0x84, 0x1f, 0x4, 0xf8, 0xc8, 0x17, 0xa3, 0x20, 0x3f, 0x5b, 0x65, 0xee, 0x26, 0xae, 0x17, 0x8, 0xe7, 0xe, 0x25, 0xca, 0x87, 0xaa, 0xd4, 0xd4}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var __000002_system_settings_tableDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\x28\xae\x2c\x2e\x49\xcd\x8d\x2f\x4e\x2d\x29\xc9\xcc\x4b\x2f\xb6\xe6\x02\x04\x00\x00\xff\xff\x8b\x60\xbf\x1e\x1c\x00\x00\x00")
|
||||
|
||||
func _000002_system_settings_tableDownSqlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
__000002_system_settings_tableDownSql,
|
||||
"000002_system_settings_table.down.sql",
|
||||
)
|
||||
}
|
||||
|
||||
var __000002_system_settings_table_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x0e\x72\x75\x0c\x71\x55\x08\x71\x74\xf2\x71\x55\xf0\x74\x53\xf0\xf3\x0f\x51\x70\x8d\xf0\x0c\x0e\x09\x56\x28\xae\x2c\x2e\x49\xcd\x8d\x2f\x4e\x2d\x29\xc9\xcc\x4b\x2f\x56\xd0\xe0\xe2\xcc\x4c\x51\x08\x73\x0c\x72\xf6\x70\x0c\xd2\x30\x34\x30\xd0\xd4\xe1\xe2\x2c\x4b\xcc\x29\x4d\x55\x08\x71\x8d\x08\xd1\xe1\xe2\x0c\x08\xf2\xf4\x75\x0c\x8a\x54\xf0\x76\x8d\x54\xd0\xc8\x4c\xd1\xe4\xd2\xb4\xe6\x02\x04\x00\x00\xff\xff\x17\x95\xca\x5b\x61\x00\x00\x00")
|
||||
func _000002_system_settings_tableDownSql() (*asset, error) {
|
||||
bytes, err := _000002_system_settings_tableDownSqlBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func _000002_system_settings_table_up_sql() ([]byte, error) {
|
||||
return bindata_read(
|
||||
__000002_system_settings_table_up_sql,
|
||||
info := bindataFileInfo{name: "000002_system_settings_table.down.sql", size: 28, mode: os.FileMode(0644), modTime: time.Unix(1603112131, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe4, 0xfd, 0xe6, 0x5d, 0xd1, 0xb2, 0xe9, 0x49, 0x14, 0x3b, 0xec, 0xb, 0x5f, 0x9d, 0x1d, 0x56, 0x13, 0x70, 0x76, 0x78, 0x7e, 0xd7, 0xd2, 0x57, 0x1e, 0xe7, 0x11, 0xb, 0xf9, 0xfb, 0x67, 0xb9}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var __000002_system_settings_tableUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x0e\x72\x75\x0c\x71\x55\x08\x71\x74\xf2\x71\x55\xf0\x74\x53\xf0\xf3\x0f\x51\x70\x8d\xf0\x0c\x0e\x09\x56\x28\xae\x2c\x2e\x49\xcd\x8d\x2f\x4e\x2d\x29\xc9\xcc\x4b\x2f\x56\xd0\xe0\xe2\xcc\x4c\x51\x08\x73\x0c\x72\xf6\x70\x0c\xd2\x30\x34\x30\xd0\xd4\xe1\xe2\x2c\x4b\xcc\x29\x4d\x55\x08\x71\x8d\x08\xd1\xe1\xe2\x0c\x08\xf2\xf4\x75\x0c\x8a\x54\xf0\x76\x8d\x54\xd0\xc8\x4c\xd1\xe4\xd2\xb4\xe6\x02\x04\x00\x00\xff\xff\x17\x95\xca\x5b\x61\x00\x00\x00")
|
||||
|
||||
func _000002_system_settings_tableUpSqlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
__000002_system_settings_tableUpSql,
|
||||
"000002_system_settings_table.up.sql",
|
||||
)
|
||||
}
|
||||
|
||||
var __000003_blocks_rootid_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\x48\xca\xc9\x4f\xce\x2e\xe6\x72\x09\xf2\x0f\x50\x70\xf6\xf7\x09\xf5\xf5\x53\x28\xca\xcf\x2f\x89\xcf\x4c\xb1\xe6\x02\x04\x00\x00\xff\xff\x94\x1c\x55\xb9\x28\x00\x00\x00")
|
||||
func _000002_system_settings_tableUpSql() (*asset, error) {
|
||||
bytes, err := _000002_system_settings_tableUpSqlBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func _000003_blocks_rootid_down_sql() ([]byte, error) {
|
||||
return bindata_read(
|
||||
__000003_blocks_rootid_down_sql,
|
||||
info := bindataFileInfo{name: "000002_system_settings_table.up.sql", size: 97, mode: os.FileMode(0644), modTime: time.Unix(1603112131, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x5, 0xac, 0x61, 0xab, 0xf5, 0x91, 0x2f, 0xfd, 0xa8, 0x27, 0xa4, 0x63, 0xd1, 0x2d, 0xf4, 0x79, 0x2a, 0x9d, 0x78, 0x94, 0xb7, 0x7a, 0xaf, 0xcb, 0x9d, 0xae, 0x10, 0x89, 0xb3, 0xeb, 0x1e, 0x5d}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var __000003_blocks_rootidDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\x48\xca\xc9\x4f\xce\x2e\xe6\x72\x09\xf2\x0f\x50\x70\xf6\xf7\x09\xf5\xf5\x53\x28\xca\xcf\x2f\x89\xcf\x4c\xb1\xe6\x02\x04\x00\x00\xff\xff\x94\x1c\x55\xb9\x28\x00\x00\x00")
|
||||
|
||||
func _000003_blocks_rootidDownSqlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
__000003_blocks_rootidDownSql,
|
||||
"000003_blocks_rootid.down.sql",
|
||||
)
|
||||
}
|
||||
|
||||
var __000003_blocks_rootid_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\x48\xca\xc9\x4f\xce\x2e\xe6\x72\x74\x71\x51\x70\xf6\xf7\x09\xf5\xf5\x53\x28\xca\xcf\x2f\x89\xcf\x4c\x51\x08\x73\x0c\x72\xf6\x70\x0c\xd2\x30\x36\xd3\xb4\xe6\x02\x04\x00\x00\xff\xff\xce\x60\x70\x4e\x33\x00\x00\x00")
|
||||
func _000003_blocks_rootidDownSql() (*asset, error) {
|
||||
bytes, err := _000003_blocks_rootidDownSqlBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func _000003_blocks_rootid_up_sql() ([]byte, error) {
|
||||
return bindata_read(
|
||||
__000003_blocks_rootid_up_sql,
|
||||
info := bindataFileInfo{name: "000003_blocks_rootid.down.sql", size: 40, mode: os.FileMode(0644), modTime: time.Unix(1607094225, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1a, 0xb4, 0xdd, 0x99, 0x6e, 0xb8, 0x1a, 0xfd, 0x54, 0x43, 0x8f, 0x9, 0x3a, 0xd1, 0xe4, 0x32, 0x20, 0x3b, 0x43, 0xf4, 0x61, 0x17, 0x9b, 0xff, 0x85, 0xb0, 0x9a, 0x48, 0x9f, 0xfd, 0xbb, 0xcc}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var __000003_blocks_rootidUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\x48\xca\xc9\x4f\xce\x2e\xe6\x72\x74\x71\x51\x70\xf6\xf7\x09\xf5\xf5\x53\x28\xca\xcf\x2f\x89\xcf\x4c\x51\x08\x73\x0c\x72\xf6\x70\x0c\xd2\x30\x36\xd3\xb4\xe6\x02\x04\x00\x00\xff\xff\xce\x60\x70\x4e\x33\x00\x00\x00")
|
||||
|
||||
func _000003_blocks_rootidUpSqlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
__000003_blocks_rootidUpSql,
|
||||
"000003_blocks_rootid.up.sql",
|
||||
)
|
||||
}
|
||||
|
||||
var __000004_auth_table_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\x28\x2d\x4e\x2d\x2a\xb6\xe6\x42\x12\x29\x4e\x2d\x2e\xce\xcc\xcf\x2b\xb6\xe6\x02\x04\x00\x00\xff\xff\xa5\xe0\x77\xaa\x27\x00\x00\x00")
|
||||
func _000003_blocks_rootidUpSql() (*asset, error) {
|
||||
bytes, err := _000003_blocks_rootidUpSqlBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func _000004_auth_table_down_sql() ([]byte, error) {
|
||||
return bindata_read(
|
||||
__000004_auth_table_down_sql,
|
||||
info := bindataFileInfo{name: "000003_blocks_rootid.up.sql", size: 51, mode: os.FileMode(0644), modTime: time.Unix(1607094225, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x20, 0x3e, 0xe3, 0x25, 0xb9, 0x60, 0x1a, 0xc2, 0xbf, 0x51, 0x2e, 0xf0, 0xbb, 0x9e, 0x61, 0xb9, 0x16, 0x19, 0xc0, 0x6, 0x7a, 0x81, 0x1c, 0xce, 0xa0, 0xea, 0x91, 0xb2, 0xf, 0xb9, 0xba, 0x91}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var __000004_auth_tableDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\x28\x2d\x4e\x2d\x2a\xb6\xe6\x42\x12\x29\x4e\x2d\x2e\xce\xcc\xcf\x2b\xb6\xe6\x02\x04\x00\x00\xff\xff\xa5\xe0\x77\xaa\x27\x00\x00\x00")
|
||||
|
||||
func _000004_auth_tableDownSqlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
__000004_auth_tableDownSql,
|
||||
"000004_auth_table.down.sql",
|
||||
)
|
||||
}
|
||||
|
||||
var __000004_auth_table_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x90\x4f\x4b\x03\x31\x10\xc5\xcf\x9b\x4f\x31\xc7\x5d\xe8\xa1\x16\x7a\xf2\x94\x96\xa8\xf1\xcf\x56\xb2\x41\xec\x69\x19\x36\x23\x06\xbb\x7f\xc8\xa4\xfa\xf5\x25\x08\x8a\xdd\xe8\xa5\x73\xfc\xbd\x61\xde\xbc\xb7\x35\x4a\x5a\x05\x56\x6e\xee\x15\xe8\x2b\xa8\x77\x16\xd4\xb3\x6e\x6c\x03\x47\xa6\xc0\x50\x8a\xc2\x3b\x78\x92\x66\x7b\x23\x4d\x79\xb1\x5c\x56\x0b\x51\x24\x69\xc0\x9e\x4e\x39\xf5\xe8\x0f\xdf\x70\xb5\x5e\x27\x38\x21\xf3\xc7\x18\x4e\x8f\x00\x00\xf4\x2f\xd8\x32\x75\x81\x62\x46\xc4\x63\x7c\x6d\x99\xc2\xbb\xef\x7e\x8c\x56\xbf\x54\x87\x11\x67\x76\x61\x9c\x18\xbe\xe6\xb6\xd9\xd5\x0b\x51\x74\x81\x30\x52\x8b\x31\xb1\x8d\xbe\xd6\xb5\x4d\x21\x26\x97\xa1\x8e\x0e\x34\xa7\x8f\x46\x3f\x48\xb3\x87\x3b\xb5\x87\xd2\xbb\x4a\x54\x97\x42\xfc\xd3\x1d\x13\xb3\x1f\x87\x3f\xea\x8b\xe3\x1b\x0d\xb9\x4e\xdb\xf9\xee\x99\x71\x72\x8f\x7f\x06\x00\x00\xff\xff\x35\x8e\x4b\xc6\xf4\x01\x00\x00")
|
||||
func _000004_auth_tableDownSql() (*asset, error) {
|
||||
bytes, err := _000004_auth_tableDownSqlBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func _000004_auth_table_up_sql() ([]byte, error) {
|
||||
return bindata_read(
|
||||
__000004_auth_table_up_sql,
|
||||
info := bindataFileInfo{name: "000004_auth_table.down.sql", size: 39, mode: os.FileMode(0644), modTime: time.Unix(1606923754, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb6, 0x5b, 0x33, 0x33, 0xd4, 0x68, 0x4, 0xb4, 0xfd, 0x61, 0x61, 0x33, 0x1b, 0xc6, 0x44, 0x5e, 0x57, 0xd0, 0xe7, 0x21, 0x36, 0xff, 0x10, 0x1a, 0xc2, 0xa2, 0xe7, 0x3a, 0xbd, 0x2e, 0xba, 0x66}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var __000004_auth_tableUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x90\x4f\x4b\x03\x31\x10\xc5\xcf\x9b\x4f\x31\xc7\x5d\xe8\xa1\x16\x7a\xf2\x94\x96\xa8\xf1\xcf\x56\xb2\x41\xec\x69\x19\x36\x23\x06\xbb\x7f\xc8\xa4\xfa\xf5\x25\x08\x16\x9a\xd5\x4b\xe7\xf8\x7b\xc3\xbc\x37\x6f\x6b\x94\xb4\x0a\xac\xdc\x3c\x2a\xd0\x37\x50\xef\x2c\xa8\x57\xdd\xd8\x06\x8e\x4c\x81\xa1\x14\x85\x77\xf0\x22\xcd\xf6\x4e\x9a\xf2\x6a\xb9\xac\x16\xa2\x48\xd2\x80\x3d\x9d\x73\xea\xd1\x1f\x7e\xe1\x6a\xbd\x4e\x70\x42\xe6\xaf\x31\x64\x47\xfa\x37\x6c\x99\xba\x40\xf1\x5c\xc1\x63\x7c\x6f\x99\xc2\xa7\xef\x4e\x16\xab\x93\xe4\x30\x62\xe6\x12\xc6\x89\xe1\x67\xee\x9b\x5d\xbd\x10\x45\x17\x08\x23\xb5\x18\x13\xdb\xe8\x5b\x5d\xdb\x94\x7d\x72\x33\xd4\xd1\x81\x72\xfa\x6c\xf4\x93\x34\x7b\x78\x50\x7b\x28\xbd\xab\x44\x75\x2d\xc4\x3f\x95\x31\x31\xfb\x71\xf8\xa3\xb5\x38\x7e\xd0\x30\x57\x65\x9b\xef\x5e\xf8\xce\x5c\xf0\xef\x00\x00\x00\xff\xff\x16\x8f\x58\x39\xeb\x01\x00\x00")
|
||||
|
||||
func _000004_auth_tableUpSqlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
__000004_auth_tableUpSql,
|
||||
"000004_auth_table.up.sql",
|
||||
)
|
||||
}
|
||||
|
||||
func _000004_auth_tableUpSql() (*asset, error) {
|
||||
bytes, err := _000004_auth_tableUpSqlBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "000004_auth_table.up.sql", size: 491, mode: os.FileMode(0644), modTime: time.Unix(1610375570, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x51, 0xbe, 0x84, 0x23, 0xcb, 0x3b, 0x88, 0xbf, 0x9e, 0xd, 0x32, 0x46, 0x47, 0xe1, 0x6e, 0xb2, 0x2e, 0x36, 0x6b, 0xde, 0x38, 0x7f, 0x0, 0x27, 0xd8, 0x10, 0x7e, 0xf2, 0xa4, 0x6, 0x73, 0xd}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
// Asset loads and returns the asset for the given name.
|
||||
// It returns an error if the asset could not be found or
|
||||
// could not be loaded.
|
||||
func Asset(name string) ([]byte, error) {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[cannonicalName]; ok {
|
||||
return f()
|
||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[canonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
|
||||
}
|
||||
return a.bytes, nil
|
||||
}
|
||||
return nil, fmt.Errorf("Asset %s not found", name)
|
||||
}
|
||||
|
||||
// AssetString returns the asset contents as a string (instead of a []byte).
|
||||
func AssetString(name string) (string, error) {
|
||||
data, err := Asset(name)
|
||||
return string(data), err
|
||||
}
|
||||
|
||||
// MustAsset is like Asset but panics when Asset would return an error.
|
||||
// It simplifies safe initialization of global variables.
|
||||
func MustAsset(name string) []byte {
|
||||
a, err := Asset(name)
|
||||
if err != nil {
|
||||
panic("asset: Asset(" + name + "): " + err.Error())
|
||||
}
|
||||
|
||||
return a
|
||||
}
|
||||
|
||||
// MustAssetString is like AssetString but panics when Asset would return an
|
||||
// error. It simplifies safe initialization of global variables.
|
||||
func MustAssetString(name string) string {
|
||||
return string(MustAsset(name))
|
||||
}
|
||||
|
||||
// AssetInfo loads and returns the asset info for the given name.
|
||||
// It returns an error if the asset could not be found or
|
||||
// could not be loaded.
|
||||
func AssetInfo(name string) (os.FileInfo, error) {
|
||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[canonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
|
||||
}
|
||||
return a.info, nil
|
||||
}
|
||||
return nil, fmt.Errorf("AssetInfo %s not found", name)
|
||||
}
|
||||
|
||||
// AssetDigest returns the digest of the file with the given name. It returns an
|
||||
// error if the asset could not be found or the digest could not be loaded.
|
||||
func AssetDigest(name string) ([sha256.Size]byte, error) {
|
||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[canonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err)
|
||||
}
|
||||
return a.digest, nil
|
||||
}
|
||||
return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name)
|
||||
}
|
||||
|
||||
// Digests returns a map of all known files and their checksums.
|
||||
func Digests() (map[string][sha256.Size]byte, error) {
|
||||
mp := make(map[string][sha256.Size]byte, len(_bindata))
|
||||
for name := range _bindata {
|
||||
a, err := _bindata[name]()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
mp[name] = a.digest
|
||||
}
|
||||
return mp, nil
|
||||
}
|
||||
|
||||
// AssetNames returns the names of the assets.
|
||||
func AssetNames() []string {
|
||||
names := make([]string, 0, len(_bindata))
|
||||
@ -118,16 +326,20 @@ func AssetNames() []string {
|
||||
}
|
||||
|
||||
// _bindata is a table, holding each asset generator, mapped to its name.
|
||||
var _bindata = map[string]func() ([]byte, error){
|
||||
"000001_init.down.sql": _000001_init_down_sql,
|
||||
"000001_init.up.sql": _000001_init_up_sql,
|
||||
"000002_system_settings_table.down.sql": _000002_system_settings_table_down_sql,
|
||||
"000002_system_settings_table.up.sql": _000002_system_settings_table_up_sql,
|
||||
"000003_blocks_rootid.down.sql": _000003_blocks_rootid_down_sql,
|
||||
"000003_blocks_rootid.up.sql": _000003_blocks_rootid_up_sql,
|
||||
"000004_auth_table.down.sql": _000004_auth_table_down_sql,
|
||||
"000004_auth_table.up.sql": _000004_auth_table_up_sql,
|
||||
var _bindata = map[string]func() (*asset, error){
|
||||
"000001_init.down.sql": _000001_initDownSql,
|
||||
"000001_init.up.sql": _000001_initUpSql,
|
||||
"000002_system_settings_table.down.sql": _000002_system_settings_tableDownSql,
|
||||
"000002_system_settings_table.up.sql": _000002_system_settings_tableUpSql,
|
||||
"000003_blocks_rootid.down.sql": _000003_blocks_rootidDownSql,
|
||||
"000003_blocks_rootid.up.sql": _000003_blocks_rootidUpSql,
|
||||
"000004_auth_table.down.sql": _000004_auth_tableDownSql,
|
||||
"000004_auth_table.up.sql": _000004_auth_tableUpSql,
|
||||
}
|
||||
|
||||
// AssetDebug is true if the assets were built with the debug flag enabled.
|
||||
const AssetDebug = false
|
||||
|
||||
// AssetDir returns the file names below a certain
|
||||
// directory embedded in the file by go-bindata.
|
||||
// For example if you run go-bindata on data/... and data contains the
|
||||
@ -137,15 +349,15 @@ var _bindata = map[string]func() ([]byte, error){
|
||||
// img/
|
||||
// a.png
|
||||
// b.png
|
||||
// then AssetDir("data") would return []string{"foo.txt", "img"}
|
||||
// AssetDir("data/img") would return []string{"a.png", "b.png"}
|
||||
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
|
||||
// then AssetDir("data") would return []string{"foo.txt", "img"},
|
||||
// AssetDir("data/img") would return []string{"a.png", "b.png"},
|
||||
// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and
|
||||
// AssetDir("") will return []string{"data"}.
|
||||
func AssetDir(name string) ([]string, error) {
|
||||
node := _bintree
|
||||
if len(name) != 0 {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
pathList := strings.Split(cannonicalName, "/")
|
||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
pathList := strings.Split(canonicalName, "/")
|
||||
for _, p := range pathList {
|
||||
node = node.Children[p]
|
||||
if node == nil {
|
||||
@ -157,31 +369,67 @@ func AssetDir(name string) ([]string, error) {
|
||||
return nil, fmt.Errorf("Asset %s not found", name)
|
||||
}
|
||||
rv := make([]string, 0, len(node.Children))
|
||||
for name := range node.Children {
|
||||
rv = append(rv, name)
|
||||
for childName := range node.Children {
|
||||
rv = append(rv, childName)
|
||||
}
|
||||
return rv, nil
|
||||
}
|
||||
|
||||
type _bintree_t struct {
|
||||
Func func() ([]byte, error)
|
||||
Children map[string]*_bintree_t
|
||||
type bintree struct {
|
||||
Func func() (*asset, error)
|
||||
Children map[string]*bintree
|
||||
}
|
||||
var _bintree = &_bintree_t{nil, map[string]*_bintree_t{
|
||||
"000001_init.down.sql": &_bintree_t{_000001_init_down_sql, map[string]*_bintree_t{
|
||||
}},
|
||||
"000001_init.up.sql": &_bintree_t{_000001_init_up_sql, map[string]*_bintree_t{
|
||||
}},
|
||||
"000002_system_settings_table.down.sql": &_bintree_t{_000002_system_settings_table_down_sql, map[string]*_bintree_t{
|
||||
}},
|
||||
"000002_system_settings_table.up.sql": &_bintree_t{_000002_system_settings_table_up_sql, map[string]*_bintree_t{
|
||||
}},
|
||||
"000003_blocks_rootid.down.sql": &_bintree_t{_000003_blocks_rootid_down_sql, map[string]*_bintree_t{
|
||||
}},
|
||||
"000003_blocks_rootid.up.sql": &_bintree_t{_000003_blocks_rootid_up_sql, map[string]*_bintree_t{
|
||||
}},
|
||||
"000004_auth_table.down.sql": &_bintree_t{_000004_auth_table_down_sql, map[string]*_bintree_t{
|
||||
}},
|
||||
"000004_auth_table.up.sql": &_bintree_t{_000004_auth_table_up_sql, map[string]*_bintree_t{
|
||||
}},
|
||||
|
||||
var _bintree = &bintree{nil, map[string]*bintree{
|
||||
"000001_init.down.sql": {_000001_initDownSql, map[string]*bintree{}},
|
||||
"000001_init.up.sql": {_000001_initUpSql, map[string]*bintree{}},
|
||||
"000002_system_settings_table.down.sql": {_000002_system_settings_tableDownSql, map[string]*bintree{}},
|
||||
"000002_system_settings_table.up.sql": {_000002_system_settings_tableUpSql, map[string]*bintree{}},
|
||||
"000003_blocks_rootid.down.sql": {_000003_blocks_rootidDownSql, map[string]*bintree{}},
|
||||
"000003_blocks_rootid.up.sql": {_000003_blocks_rootidUpSql, map[string]*bintree{}},
|
||||
"000004_auth_table.down.sql": {_000004_auth_tableDownSql, map[string]*bintree{}},
|
||||
"000004_auth_table.up.sql": {_000004_auth_tableUpSql, map[string]*bintree{}},
|
||||
}}
|
||||
|
||||
// RestoreAsset restores an asset under the given directory.
|
||||
func RestoreAsset(dir, name string) error {
|
||||
data, err := Asset(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
info, err := AssetInfo(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
|
||||
}
|
||||
|
||||
// RestoreAssets restores an asset under the given directory recursively.
|
||||
func RestoreAssets(dir, name string) error {
|
||||
children, err := AssetDir(name)
|
||||
// File
|
||||
if err != nil {
|
||||
return RestoreAsset(dir, name)
|
||||
}
|
||||
// Dir
|
||||
for _, child := range children {
|
||||
err = RestoreAssets(dir, filepath.Join(name, child))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func _filePath(dir, name string) string {
|
||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...)
|
||||
}
|
||||
|
@ -1,113 +1,321 @@
|
||||
// Code generated by go-bindata. DO NOT EDIT.
|
||||
// sources:
|
||||
// sqlite_files/000001_init.down.sql (19B)
|
||||
// sqlite_files/000001_init.up.sql (297B)
|
||||
// sqlite_files/000002_system_settings_table.down.sql (28B)
|
||||
// sqlite_files/000002_system_settings_table.up.sql (96B)
|
||||
// sqlite_files/000003_blocks_rootid.down.sql (40B)
|
||||
// sqlite_files/000003_blocks_rootid.up.sql (51B)
|
||||
// sqlite_files/000004_auth_table.down.sql (39B)
|
||||
// sqlite_files/000004_auth_table.up.sql (491B)
|
||||
|
||||
package sqlite
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func bindata_read(data []byte, name string) ([]byte, error) {
|
||||
func bindataRead(data []byte, name string) ([]byte, error) {
|
||||
gz, err := gzip.NewReader(bytes.NewBuffer(data))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Read %q: %v", name, err)
|
||||
return nil, fmt.Errorf("read %q: %w", name, err)
|
||||
}
|
||||
|
||||
var buf bytes.Buffer
|
||||
_, err = io.Copy(&buf, gz)
|
||||
gz.Close()
|
||||
clErr := gz.Close()
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Read %q: %v", name, err)
|
||||
return nil, fmt.Errorf("read %q: %w", name, err)
|
||||
}
|
||||
if clErr != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
var __000001_init_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\x48\xca\xc9\x4f\xce\x2e\xb6\xe6\x02\x04\x00\x00\xff\xff\x45\xbe\x01\x0f\x13\x00\x00\x00")
|
||||
type asset struct {
|
||||
bytes []byte
|
||||
info os.FileInfo
|
||||
digest [sha256.Size]byte
|
||||
}
|
||||
|
||||
func _000001_init_down_sql() ([]byte, error) {
|
||||
return bindata_read(
|
||||
__000001_init_down_sql,
|
||||
type bindataFileInfo struct {
|
||||
name string
|
||||
size int64
|
||||
mode os.FileMode
|
||||
modTime time.Time
|
||||
}
|
||||
|
||||
func (fi bindataFileInfo) Name() string {
|
||||
return fi.name
|
||||
}
|
||||
func (fi bindataFileInfo) Size() int64 {
|
||||
return fi.size
|
||||
}
|
||||
func (fi bindataFileInfo) Mode() os.FileMode {
|
||||
return fi.mode
|
||||
}
|
||||
func (fi bindataFileInfo) ModTime() time.Time {
|
||||
return fi.modTime
|
||||
}
|
||||
func (fi bindataFileInfo) IsDir() bool {
|
||||
return false
|
||||
}
|
||||
func (fi bindataFileInfo) Sys() interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
var __000001_initDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\x48\xca\xc9\x4f\xce\x2e\xb6\xe6\x02\x04\x00\x00\xff\xff\x45\xbe\x01\x0f\x13\x00\x00\x00")
|
||||
|
||||
func _000001_initDownSqlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
__000001_initDownSql,
|
||||
"000001_init.down.sql",
|
||||
)
|
||||
}
|
||||
|
||||
var __000001_init_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x64\x8f\xbf\x6e\x83\x30\x10\x87\x67\xfc\x14\xb7\x58\x18\x89\x4c\x95\x3a\xa4\x93\x93\x1c\x8d\x55\x20\x95\xb9\xb4\x61\x8a\x28\xbe\xa8\x56\x49\x8a\xc0\x1d\xfa\xf6\x15\x91\xca\x90\x6c\xf7\xfb\x4e\xdf\xfd\x59\x5b\xd4\x84\x40\x7a\x95\x23\x98\x0c\xca\x1d\x01\x1e\x4c\x45\x15\x7c\x74\xdf\xed\xd7\x08\x4a\x44\xde\xc1\x9b\xb6\xeb\xad\xb6\xea\xe1\x31\x49\x45\xe4\x2f\x23\x0f\xe1\xd8\x04\xd8\x68\x42\x32\x05\x5e\xc5\x72\x9f\xe7\xb0\xc1\x4c\xef\x73\x52\x15\xd9\x6c\xea\xa8\x58\xd6\x0b\x79\x5e\x48\x07\x72\xbb\x94\xc5\x52\x9e\xe2\x14\xe2\x72\xf7\x1e\x27\xd3\xac\xbe\x19\xf8\x12\x8e\x77\x3b\xc6\xf6\x93\xcf\x0d\xac\xcc\xb3\x29\x29\x15\x51\xf8\xed\x19\x08\x0f\xd7\xda\x87\x6e\x0e\x27\xcf\x9d\x1b\xff\x53\x3b\x70\x13\x78\x3a\x6d\x36\x7f\x7a\x77\x8b\x1c\x77\x7c\x83\x5e\xad\x29\xb4\xad\xe1\x05\x6b\x50\xde\xa5\x30\x3f\x99\x88\xe4\x49\xfc\x05\x00\x00\xff\xff\xa2\x33\x30\x8e\x29\x01\x00\x00")
|
||||
func _000001_initDownSql() (*asset, error) {
|
||||
bytes, err := _000001_initDownSqlBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func _000001_init_up_sql() ([]byte, error) {
|
||||
return bindata_read(
|
||||
__000001_init_up_sql,
|
||||
info := bindataFileInfo{name: "000001_init.down.sql", size: 19, mode: os.FileMode(0644), modTime: time.Unix(1602958996, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe4, 0x9a, 0x67, 0x49, 0xbf, 0xf7, 0xaa, 0x0, 0xe2, 0x48, 0xe4, 0xe2, 0xdc, 0x1, 0x8b, 0xa3, 0x24, 0x4, 0xcc, 0xbd, 0x3d, 0xbd, 0xf8, 0xec, 0xcf, 0x54, 0x9e, 0xc6, 0x83, 0x69, 0x7c, 0xb0}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var __000001_initUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x64\x8f\xbf\x6e\x83\x30\x10\x87\x67\xfc\x14\xb7\x58\x18\x89\x4c\x95\x3a\xa4\x93\x93\x1c\x8d\x55\x20\x95\xb9\xb4\x61\x8a\x28\xbe\xa8\x56\x49\x8a\xc0\x1d\xfa\xf6\x15\x91\xca\x90\x6c\xf7\xfb\x4e\xdf\xfd\x59\x5b\xd4\x84\x40\x7a\x95\x23\x98\x0c\xca\x1d\x01\x1e\x4c\x45\x15\x7c\x74\xdf\xed\xd7\x08\x4a\x44\xde\xc1\x9b\xb6\xeb\xad\xb6\xea\xe1\x31\x49\x45\xe4\x2f\x23\x0f\xe1\xd8\x04\xd8\x68\x42\x32\x05\x5e\xc5\x72\x9f\xe7\xb0\xc1\x4c\xef\x73\x52\x15\xd9\x6c\xea\xa8\x58\xd6\x0b\x79\x5e\x48\x07\x72\xbb\x94\xc5\x52\x9e\xe2\x14\xe2\x72\xf7\x1e\x27\xd3\xac\xbe\x19\xf8\x12\x8e\x77\x3b\xc6\xf6\x93\xcf\x0d\xac\xcc\xb3\x29\x29\x15\x51\xf8\xed\x19\x08\x0f\xd7\xda\x87\x6e\x0e\x27\xcf\x9d\x1b\xff\x53\x3b\x70\x13\x78\x3a\x6d\x36\x7f\x7a\x77\x8b\x1c\x77\x7c\x83\x5e\xad\x29\xb4\xad\xe1\x05\x6b\x50\xde\xa5\x30\x3f\x99\x88\xe4\x49\xfc\x05\x00\x00\xff\xff\xa2\x33\x30\x8e\x29\x01\x00\x00")
|
||||
|
||||
func _000001_initUpSqlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
__000001_initUpSql,
|
||||
"000001_init.up.sql",
|
||||
)
|
||||
}
|
||||
|
||||
var __000002_system_settings_table_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\x28\xae\x2c\x2e\x49\xcd\x8d\x2f\x4e\x2d\x29\xc9\xcc\x4b\x2f\xb6\xe6\x02\x04\x00\x00\xff\xff\x8b\x60\xbf\x1e\x1c\x00\x00\x00")
|
||||
func _000001_initUpSql() (*asset, error) {
|
||||
bytes, err := _000001_initUpSqlBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func _000002_system_settings_table_down_sql() ([]byte, error) {
|
||||
return bindata_read(
|
||||
__000002_system_settings_table_down_sql,
|
||||
info := bindataFileInfo{name: "000001_init.up.sql", size: 297, mode: os.FileMode(0644), modTime: time.Unix(1603029845, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xcc, 0xb4, 0xcf, 0xde, 0xfb, 0xcc, 0xa1, 0xf8, 0x73, 0x51, 0x3b, 0xbf, 0x6a, 0xb0, 0xd0, 0x6b, 0xdf, 0xb0, 0x76, 0xaf, 0x4e, 0x89, 0x21, 0xc7, 0x8e, 0xe8, 0x18, 0x50, 0xc7, 0x9, 0xd8, 0xbf}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var __000002_system_settings_tableDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\x28\xae\x2c\x2e\x49\xcd\x8d\x2f\x4e\x2d\x29\xc9\xcc\x4b\x2f\xb6\xe6\x02\x04\x00\x00\xff\xff\x8b\x60\xbf\x1e\x1c\x00\x00\x00")
|
||||
|
||||
func _000002_system_settings_tableDownSqlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
__000002_system_settings_tableDownSql,
|
||||
"000002_system_settings_table.down.sql",
|
||||
)
|
||||
}
|
||||
|
||||
var __000002_system_settings_table_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x0e\x72\x75\x0c\x71\x55\x08\x71\x74\xf2\x71\x55\xf0\x74\x53\xf0\xf3\x0f\x51\x70\x8d\xf0\x0c\x0e\x09\x56\x28\xae\x2c\x2e\x49\xcd\x8d\x2f\x4e\x2d\x29\xc9\xcc\x4b\x2f\xd6\xe0\xe2\xcc\x4c\x51\x08\x73\x0c\x72\xf6\x70\x0c\xd2\x30\x34\x30\xd0\xd4\xe1\xe2\x2c\x4b\xcc\x29\x4d\x55\x08\x71\x8d\x08\xd1\xe1\xe2\x0c\x08\xf2\xf4\x75\x0c\x8a\x54\xf0\x76\x8d\x54\xd0\xc8\x4c\xd1\xe4\xd2\xb4\xe6\x02\x04\x00\x00\xff\xff\x1e\xfb\x02\xf2\x60\x00\x00\x00")
|
||||
func _000002_system_settings_tableDownSql() (*asset, error) {
|
||||
bytes, err := _000002_system_settings_tableDownSqlBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func _000002_system_settings_table_up_sql() ([]byte, error) {
|
||||
return bindata_read(
|
||||
__000002_system_settings_table_up_sql,
|
||||
info := bindataFileInfo{name: "000002_system_settings_table.down.sql", size: 28, mode: os.FileMode(0644), modTime: time.Unix(1603112131, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe4, 0xfd, 0xe6, 0x5d, 0xd1, 0xb2, 0xe9, 0x49, 0x14, 0x3b, 0xec, 0xb, 0x5f, 0x9d, 0x1d, 0x56, 0x13, 0x70, 0x76, 0x78, 0x7e, 0xd7, 0xd2, 0x57, 0x1e, 0xe7, 0x11, 0xb, 0xf9, 0xfb, 0x67, 0xb9}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var __000002_system_settings_tableUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x0e\x72\x75\x0c\x71\x55\x08\x71\x74\xf2\x71\x55\xf0\x74\x53\xf0\xf3\x0f\x51\x70\x8d\xf0\x0c\x0e\x09\x56\x28\xae\x2c\x2e\x49\xcd\x8d\x2f\x4e\x2d\x29\xc9\xcc\x4b\x2f\xd6\xe0\xe2\xcc\x4c\x51\x08\x73\x0c\x72\xf6\x70\x0c\xd2\x30\x34\x30\xd0\xd4\xe1\xe2\x2c\x4b\xcc\x29\x4d\x55\x08\x71\x8d\x08\xd1\xe1\xe2\x0c\x08\xf2\xf4\x75\x0c\x8a\x54\xf0\x76\x8d\x54\xd0\xc8\x4c\xd1\xe4\xd2\xb4\xe6\x02\x04\x00\x00\xff\xff\x1e\xfb\x02\xf2\x60\x00\x00\x00")
|
||||
|
||||
func _000002_system_settings_tableUpSqlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
__000002_system_settings_tableUpSql,
|
||||
"000002_system_settings_table.up.sql",
|
||||
)
|
||||
}
|
||||
|
||||
var __000003_blocks_rootid_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\x48\xca\xc9\x4f\xce\x2e\xe6\x72\x09\xf2\x0f\x50\x70\xf6\xf7\x09\xf5\xf5\x53\x28\xca\xcf\x2f\x89\xcf\x4c\xb1\xe6\x02\x04\x00\x00\xff\xff\x94\x1c\x55\xb9\x28\x00\x00\x00")
|
||||
func _000002_system_settings_tableUpSql() (*asset, error) {
|
||||
bytes, err := _000002_system_settings_tableUpSqlBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func _000003_blocks_rootid_down_sql() ([]byte, error) {
|
||||
return bindata_read(
|
||||
__000003_blocks_rootid_down_sql,
|
||||
info := bindataFileInfo{name: "000002_system_settings_table.up.sql", size: 96, mode: os.FileMode(0644), modTime: time.Unix(1603112131, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x24, 0x6f, 0x66, 0x74, 0xbf, 0xec, 0xae, 0x5a, 0x56, 0x95, 0x4b, 0x4d, 0xaa, 0xf6, 0x8, 0xae, 0x88, 0x62, 0x21, 0x4f, 0xdc, 0xb1, 0x3, 0x30, 0x79, 0xd4, 0xc2, 0x17, 0x2, 0x9e, 0x1c, 0x8e}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var __000003_blocks_rootidDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\x48\xca\xc9\x4f\xce\x2e\xe6\x72\x09\xf2\x0f\x50\x70\xf6\xf7\x09\xf5\xf5\x53\x28\xca\xcf\x2f\x89\xcf\x4c\xb1\xe6\x02\x04\x00\x00\xff\xff\x94\x1c\x55\xb9\x28\x00\x00\x00")
|
||||
|
||||
func _000003_blocks_rootidDownSqlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
__000003_blocks_rootidDownSql,
|
||||
"000003_blocks_rootid.down.sql",
|
||||
)
|
||||
}
|
||||
|
||||
var __000003_blocks_rootid_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\x48\xca\xc9\x4f\xce\x2e\xe6\x72\x74\x71\x51\x70\xf6\xf7\x09\xf5\xf5\x53\x28\xca\xcf\x2f\x89\xcf\x4c\x51\x08\x73\x0c\x72\xf6\x70\x0c\xd2\x30\x36\xd3\xb4\xe6\x02\x04\x00\x00\xff\xff\xce\x60\x70\x4e\x33\x00\x00\x00")
|
||||
func _000003_blocks_rootidDownSql() (*asset, error) {
|
||||
bytes, err := _000003_blocks_rootidDownSqlBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func _000003_blocks_rootid_up_sql() ([]byte, error) {
|
||||
return bindata_read(
|
||||
__000003_blocks_rootid_up_sql,
|
||||
info := bindataFileInfo{name: "000003_blocks_rootid.down.sql", size: 40, mode: os.FileMode(0644), modTime: time.Unix(1607094225, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1a, 0xb4, 0xdd, 0x99, 0x6e, 0xb8, 0x1a, 0xfd, 0x54, 0x43, 0x8f, 0x9, 0x3a, 0xd1, 0xe4, 0x32, 0x20, 0x3b, 0x43, 0xf4, 0x61, 0x17, 0x9b, 0xff, 0x85, 0xb0, 0x9a, 0x48, 0x9f, 0xfd, 0xbb, 0xcc}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var __000003_blocks_rootidUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\x48\xca\xc9\x4f\xce\x2e\xe6\x72\x74\x71\x51\x70\xf6\xf7\x09\xf5\xf5\x53\x28\xca\xcf\x2f\x89\xcf\x4c\x51\x08\x73\x0c\x72\xf6\x70\x0c\xd2\x30\x36\xd3\xb4\xe6\x02\x04\x00\x00\xff\xff\xce\x60\x70\x4e\x33\x00\x00\x00")
|
||||
|
||||
func _000003_blocks_rootidUpSqlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
__000003_blocks_rootidUpSql,
|
||||
"000003_blocks_rootid.up.sql",
|
||||
)
|
||||
}
|
||||
|
||||
var __000004_auth_table_down_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\x28\x2d\x4e\x2d\x2a\xb6\xe6\x42\x12\x29\x4e\x2d\x2e\xce\xcc\xcf\x2b\xb6\xe6\x02\x04\x00\x00\xff\xff\xa5\xe0\x77\xaa\x27\x00\x00\x00")
|
||||
func _000003_blocks_rootidUpSql() (*asset, error) {
|
||||
bytes, err := _000003_blocks_rootidUpSqlBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func _000004_auth_table_down_sql() ([]byte, error) {
|
||||
return bindata_read(
|
||||
__000004_auth_table_down_sql,
|
||||
info := bindataFileInfo{name: "000003_blocks_rootid.up.sql", size: 51, mode: os.FileMode(0644), modTime: time.Unix(1607094225, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x20, 0x3e, 0xe3, 0x25, 0xb9, 0x60, 0x1a, 0xc2, 0xbf, 0x51, 0x2e, 0xf0, 0xbb, 0x9e, 0x61, 0xb9, 0x16, 0x19, 0xc0, 0x6, 0x7a, 0x81, 0x1c, 0xce, 0xa0, 0xea, 0x91, 0xb2, 0xf, 0xb9, 0xba, 0x91}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var __000004_auth_tableDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\x28\x2d\x4e\x2d\x2a\xb6\xe6\x42\x12\x29\x4e\x2d\x2e\xce\xcc\xcf\x2b\xb6\xe6\x02\x04\x00\x00\xff\xff\xa5\xe0\x77\xaa\x27\x00\x00\x00")
|
||||
|
||||
func _000004_auth_tableDownSqlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
__000004_auth_tableDownSql,
|
||||
"000004_auth_table.down.sql",
|
||||
)
|
||||
}
|
||||
|
||||
var __000004_auth_table_up_sql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\xd0\xc1\x4a\x03\x31\x10\x06\xe0\xf3\xe6\x29\xe6\xb8\x0b\x3d\xd4\x42\x4f\x9e\xd2\x12\x35\xa8\x55\xd2\x20\xed\x69\x19\x36\x23\x06\xbb\x9b\x25\x93\xd5\xd7\x97\x20\x28\x76\xa3\x17\x73\xfc\xfe\x90\xc9\xfc\x5b\xa3\xa4\x55\x60\xe5\xe6\x4e\x81\xbe\x82\xdd\x83\x05\x75\xd0\x7b\xbb\x87\x89\x29\x32\xd4\xa2\xf2\x0e\x9e\xa4\xd9\xde\x48\x53\x5f\x2c\x97\xcd\x42\x54\x39\x1a\xb0\xa7\x73\xa7\x1e\xfd\xe9\x0b\x57\xeb\x75\xc6\x11\x99\xdf\x43\x3c\x7f\x04\x00\xa0\x7f\xc6\x96\xa9\x8b\x94\x0a\x21\x4e\xe9\xa5\x65\x8a\x6f\xbe\xfb\x1e\xb4\xfa\x91\x3a\x4c\x38\x1b\x17\xc3\xc8\xf0\x79\xac\x3a\xd8\x85\xa8\xba\x48\x98\xa8\xc5\x94\x6d\xa3\xaf\xf5\x2e\xeb\x34\xba\x82\x3a\x3a\xd1\x5c\x1f\x8d\xbe\x97\xe6\x08\xb7\xea\x08\xb5\x77\x8d\x68\x2e\x85\xf8\xa3\x3b\x26\x66\x1f\x86\x5f\xea\x4b\xe1\x95\x86\x52\xa7\xed\xfc\xee\x3f\xd7\x29\x7d\xfc\x23\x00\x00\xff\xff\xa1\xd6\x24\xe6\xf4\x01\x00\x00")
|
||||
func _000004_auth_tableDownSql() (*asset, error) {
|
||||
bytes, err := _000004_auth_tableDownSqlBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func _000004_auth_table_up_sql() ([]byte, error) {
|
||||
return bindata_read(
|
||||
__000004_auth_table_up_sql,
|
||||
info := bindataFileInfo{name: "000004_auth_table.down.sql", size: 39, mode: os.FileMode(0644), modTime: time.Unix(1606923777, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb6, 0x5b, 0x33, 0x33, 0xd4, 0x68, 0x4, 0xb4, 0xfd, 0x61, 0x61, 0x33, 0x1b, 0xc6, 0x44, 0x5e, 0x57, 0xd0, 0xe7, 0x21, 0x36, 0xff, 0x10, 0x1a, 0xc2, 0xa2, 0xe7, 0x3a, 0xbd, 0x2e, 0xba, 0x66}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var __000004_auth_tableUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\xd0\xc1\x4a\x03\x31\x10\x06\xe0\xf3\xe6\x29\xe6\xb8\x0b\x3d\xd4\x42\x4f\x9e\xd2\x12\x35\xa8\x55\xd2\x20\xed\x69\x19\x36\x23\x06\xbb\x9b\x25\x93\xd5\xd7\x97\x20\x58\x68\x56\x2f\xe6\xf8\xfd\x21\x93\xf9\xb7\x46\x49\xab\xc0\xca\xcd\x83\x02\x7d\x03\xbb\x27\x0b\xea\xa0\xf7\x76\x0f\x13\x53\x64\xa8\x45\xe5\x1d\xbc\x48\xb3\xbd\x93\xa6\xbe\x5a\x2e\x9b\x85\xa8\x72\x34\x60\x4f\x97\x4e\x3d\xfa\xd3\x0f\xae\xd6\xeb\x8c\x23\x32\x7f\x86\x58\x3c\xd2\xbf\x62\xcb\xd4\x45\x4a\x97\x09\x4e\xe9\xad\x65\x8a\x1f\xbe\x3b\x8f\x58\x9d\x23\x87\x09\x8b\x29\x31\x8c\x0c\xdf\xc7\xaa\x83\x5d\x88\xaa\x8b\x84\x89\x5a\x4c\xd9\x36\xfa\x56\xef\xb2\x4e\xa3\x9b\x51\x47\x27\x2a\xf5\xd9\xe8\x47\x69\x8e\x70\xaf\x8e\x50\x7b\xd7\x88\xe6\x5a\x88\x3f\x2a\x63\x62\xf6\x61\xf8\xa5\xb5\x14\xde\x69\x98\xab\xb2\x2d\xef\xfe\x73\x9d\xb9\x8f\x7f\x05\x00\x00\xff\xff\x82\xd7\x37\x19\xeb\x01\x00\x00")
|
||||
|
||||
func _000004_auth_tableUpSqlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
__000004_auth_tableUpSql,
|
||||
"000004_auth_table.up.sql",
|
||||
)
|
||||
}
|
||||
|
||||
func _000004_auth_tableUpSql() (*asset, error) {
|
||||
bytes, err := _000004_auth_tableUpSqlBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "000004_auth_table.up.sql", size: 491, mode: os.FileMode(0644), modTime: time.Unix(1610375590, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb6, 0xf9, 0x52, 0xb2, 0x63, 0x7b, 0x65, 0xea, 0x26, 0xeb, 0xa3, 0x8c, 0x5, 0x70, 0xd7, 0x4e, 0xd0, 0x63, 0x75, 0xc6, 0x7d, 0xf4, 0x5d, 0x11, 0x62, 0x8e, 0x94, 0x43, 0x25, 0x0, 0xaa, 0xf2}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
// Asset loads and returns the asset for the given name.
|
||||
// It returns an error if the asset could not be found or
|
||||
// could not be loaded.
|
||||
func Asset(name string) ([]byte, error) {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[cannonicalName]; ok {
|
||||
return f()
|
||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[canonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
|
||||
}
|
||||
return a.bytes, nil
|
||||
}
|
||||
return nil, fmt.Errorf("Asset %s not found", name)
|
||||
}
|
||||
|
||||
// AssetString returns the asset contents as a string (instead of a []byte).
|
||||
func AssetString(name string) (string, error) {
|
||||
data, err := Asset(name)
|
||||
return string(data), err
|
||||
}
|
||||
|
||||
// MustAsset is like Asset but panics when Asset would return an error.
|
||||
// It simplifies safe initialization of global variables.
|
||||
func MustAsset(name string) []byte {
|
||||
a, err := Asset(name)
|
||||
if err != nil {
|
||||
panic("asset: Asset(" + name + "): " + err.Error())
|
||||
}
|
||||
|
||||
return a
|
||||
}
|
||||
|
||||
// MustAssetString is like AssetString but panics when Asset would return an
|
||||
// error. It simplifies safe initialization of global variables.
|
||||
func MustAssetString(name string) string {
|
||||
return string(MustAsset(name))
|
||||
}
|
||||
|
||||
// AssetInfo loads and returns the asset info for the given name.
|
||||
// It returns an error if the asset could not be found or
|
||||
// could not be loaded.
|
||||
func AssetInfo(name string) (os.FileInfo, error) {
|
||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[canonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
|
||||
}
|
||||
return a.info, nil
|
||||
}
|
||||
return nil, fmt.Errorf("AssetInfo %s not found", name)
|
||||
}
|
||||
|
||||
// AssetDigest returns the digest of the file with the given name. It returns an
|
||||
// error if the asset could not be found or the digest could not be loaded.
|
||||
func AssetDigest(name string) ([sha256.Size]byte, error) {
|
||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[canonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err)
|
||||
}
|
||||
return a.digest, nil
|
||||
}
|
||||
return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name)
|
||||
}
|
||||
|
||||
// Digests returns a map of all known files and their checksums.
|
||||
func Digests() (map[string][sha256.Size]byte, error) {
|
||||
mp := make(map[string][sha256.Size]byte, len(_bindata))
|
||||
for name := range _bindata {
|
||||
a, err := _bindata[name]()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
mp[name] = a.digest
|
||||
}
|
||||
return mp, nil
|
||||
}
|
||||
|
||||
// AssetNames returns the names of the assets.
|
||||
func AssetNames() []string {
|
||||
names := make([]string, 0, len(_bindata))
|
||||
@ -118,16 +326,20 @@ func AssetNames() []string {
|
||||
}
|
||||
|
||||
// _bindata is a table, holding each asset generator, mapped to its name.
|
||||
var _bindata = map[string]func() ([]byte, error){
|
||||
"000001_init.down.sql": _000001_init_down_sql,
|
||||
"000001_init.up.sql": _000001_init_up_sql,
|
||||
"000002_system_settings_table.down.sql": _000002_system_settings_table_down_sql,
|
||||
"000002_system_settings_table.up.sql": _000002_system_settings_table_up_sql,
|
||||
"000003_blocks_rootid.down.sql": _000003_blocks_rootid_down_sql,
|
||||
"000003_blocks_rootid.up.sql": _000003_blocks_rootid_up_sql,
|
||||
"000004_auth_table.down.sql": _000004_auth_table_down_sql,
|
||||
"000004_auth_table.up.sql": _000004_auth_table_up_sql,
|
||||
var _bindata = map[string]func() (*asset, error){
|
||||
"000001_init.down.sql": _000001_initDownSql,
|
||||
"000001_init.up.sql": _000001_initUpSql,
|
||||
"000002_system_settings_table.down.sql": _000002_system_settings_tableDownSql,
|
||||
"000002_system_settings_table.up.sql": _000002_system_settings_tableUpSql,
|
||||
"000003_blocks_rootid.down.sql": _000003_blocks_rootidDownSql,
|
||||
"000003_blocks_rootid.up.sql": _000003_blocks_rootidUpSql,
|
||||
"000004_auth_table.down.sql": _000004_auth_tableDownSql,
|
||||
"000004_auth_table.up.sql": _000004_auth_tableUpSql,
|
||||
}
|
||||
|
||||
// AssetDebug is true if the assets were built with the debug flag enabled.
|
||||
const AssetDebug = false
|
||||
|
||||
// AssetDir returns the file names below a certain
|
||||
// directory embedded in the file by go-bindata.
|
||||
// For example if you run go-bindata on data/... and data contains the
|
||||
@ -137,15 +349,15 @@ var _bindata = map[string]func() ([]byte, error){
|
||||
// img/
|
||||
// a.png
|
||||
// b.png
|
||||
// then AssetDir("data") would return []string{"foo.txt", "img"}
|
||||
// AssetDir("data/img") would return []string{"a.png", "b.png"}
|
||||
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
|
||||
// then AssetDir("data") would return []string{"foo.txt", "img"},
|
||||
// AssetDir("data/img") would return []string{"a.png", "b.png"},
|
||||
// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and
|
||||
// AssetDir("") will return []string{"data"}.
|
||||
func AssetDir(name string) ([]string, error) {
|
||||
node := _bintree
|
||||
if len(name) != 0 {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
pathList := strings.Split(cannonicalName, "/")
|
||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
pathList := strings.Split(canonicalName, "/")
|
||||
for _, p := range pathList {
|
||||
node = node.Children[p]
|
||||
if node == nil {
|
||||
@ -157,31 +369,67 @@ func AssetDir(name string) ([]string, error) {
|
||||
return nil, fmt.Errorf("Asset %s not found", name)
|
||||
}
|
||||
rv := make([]string, 0, len(node.Children))
|
||||
for name := range node.Children {
|
||||
rv = append(rv, name)
|
||||
for childName := range node.Children {
|
||||
rv = append(rv, childName)
|
||||
}
|
||||
return rv, nil
|
||||
}
|
||||
|
||||
type _bintree_t struct {
|
||||
Func func() ([]byte, error)
|
||||
Children map[string]*_bintree_t
|
||||
type bintree struct {
|
||||
Func func() (*asset, error)
|
||||
Children map[string]*bintree
|
||||
}
|
||||
var _bintree = &_bintree_t{nil, map[string]*_bintree_t{
|
||||
"000001_init.down.sql": &_bintree_t{_000001_init_down_sql, map[string]*_bintree_t{
|
||||
}},
|
||||
"000001_init.up.sql": &_bintree_t{_000001_init_up_sql, map[string]*_bintree_t{
|
||||
}},
|
||||
"000002_system_settings_table.down.sql": &_bintree_t{_000002_system_settings_table_down_sql, map[string]*_bintree_t{
|
||||
}},
|
||||
"000002_system_settings_table.up.sql": &_bintree_t{_000002_system_settings_table_up_sql, map[string]*_bintree_t{
|
||||
}},
|
||||
"000003_blocks_rootid.down.sql": &_bintree_t{_000003_blocks_rootid_down_sql, map[string]*_bintree_t{
|
||||
}},
|
||||
"000003_blocks_rootid.up.sql": &_bintree_t{_000003_blocks_rootid_up_sql, map[string]*_bintree_t{
|
||||
}},
|
||||
"000004_auth_table.down.sql": &_bintree_t{_000004_auth_table_down_sql, map[string]*_bintree_t{
|
||||
}},
|
||||
"000004_auth_table.up.sql": &_bintree_t{_000004_auth_table_up_sql, map[string]*_bintree_t{
|
||||
}},
|
||||
|
||||
var _bintree = &bintree{nil, map[string]*bintree{
|
||||
"000001_init.down.sql": {_000001_initDownSql, map[string]*bintree{}},
|
||||
"000001_init.up.sql": {_000001_initUpSql, map[string]*bintree{}},
|
||||
"000002_system_settings_table.down.sql": {_000002_system_settings_tableDownSql, map[string]*bintree{}},
|
||||
"000002_system_settings_table.up.sql": {_000002_system_settings_tableUpSql, map[string]*bintree{}},
|
||||
"000003_blocks_rootid.down.sql": {_000003_blocks_rootidDownSql, map[string]*bintree{}},
|
||||
"000003_blocks_rootid.up.sql": {_000003_blocks_rootidUpSql, map[string]*bintree{}},
|
||||
"000004_auth_table.down.sql": {_000004_auth_tableDownSql, map[string]*bintree{}},
|
||||
"000004_auth_table.up.sql": {_000004_auth_tableUpSql, map[string]*bintree{}},
|
||||
}}
|
||||
|
||||
// RestoreAsset restores an asset under the given directory.
|
||||
func RestoreAsset(dir, name string) error {
|
||||
data, err := Asset(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
info, err := AssetInfo(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
|
||||
}
|
||||
|
||||
// RestoreAssets restores an asset under the given directory recursively.
|
||||
func RestoreAssets(dir, name string) error {
|
||||
children, err := AssetDir(name)
|
||||
// File
|
||||
if err != nil {
|
||||
return RestoreAsset(dir, name)
|
||||
}
|
||||
// Dir
|
||||
for _, child := range children {
|
||||
err = RestoreAssets(dir, filepath.Join(name, child))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func _filePath(dir, name string) string {
|
||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user