Browse Source

🔧 jteeuwen/go-bindata --> go-bindata/go-bindata

Signed-off-by: William Zhang <warmchang@outlook.com>
pull/729/head
William Zhang 5 years ago
parent
commit
bdb8550638
  1. 2
      pkg/codegen/main.go
  2. 17
      pkg/deploy/zz_generated_bindata.go
  3. 17
      pkg/openapi/zz_generated_bindata.go
  4. 17
      pkg/static/zz_generated_bindata.go
  5. 4
      trash.lock
  6. 4
      vendor.conf
  7. 16
      vendor/github.com/go-bindata/go-bindata/.gitignore
  8. 0
      vendor/github.com/go-bindata/go-bindata/CONTRIBUTING.md
  9. 0
      vendor/github.com/go-bindata/go-bindata/LICENSE
  10. 0
      vendor/github.com/go-bindata/go-bindata/Makefile
  11. 18
      vendor/github.com/go-bindata/go-bindata/README.md
  12. 1
      vendor/github.com/go-bindata/go-bindata/_config.yml
  13. 0
      vendor/github.com/go-bindata/go-bindata/asset.go
  14. 0
      vendor/github.com/go-bindata/go-bindata/bytewriter.go
  15. 5
      vendor/github.com/go-bindata/go-bindata/config.go
  16. 10
      vendor/github.com/go-bindata/go-bindata/convert.go
  17. 90
      vendor/github.com/go-bindata/go-bindata/convert_test.go
  18. 29
      vendor/github.com/go-bindata/go-bindata/debug.go
  19. 0
      vendor/github.com/go-bindata/go-bindata/doc.go
  20. 102
      vendor/github.com/go-bindata/go-bindata/file.go
  21. 1
      vendor/github.com/go-bindata/go-bindata/go-bindata/.gitignore
  22. 0
      vendor/github.com/go-bindata/go-bindata/go-bindata/AppendSliceValue.go
  23. 3
      vendor/github.com/go-bindata/go-bindata/go-bindata/main.go
  24. 2
      vendor/github.com/go-bindata/go-bindata/go-bindata/version.go
  25. 128
      vendor/github.com/go-bindata/go-bindata/release.go
  26. 1
      vendor/github.com/go-bindata/go-bindata/restore.go
  27. 0
      vendor/github.com/go-bindata/go-bindata/stringwriter.go
  28. 33
      vendor/github.com/go-bindata/go-bindata/testdata/Makefile
  29. 1
      vendor/github.com/go-bindata/go-bindata/testdata/dupname/foo/bar
  30. 1
      vendor/github.com/go-bindata/go-bindata/testdata/dupname/foo_bar
  31. 1
      vendor/github.com/go-bindata/go-bindata/testdata/in/a/test.asset
  32. 1
      vendor/github.com/go-bindata/go-bindata/testdata/in/b/test.asset
  33. 1
      vendor/github.com/go-bindata/go-bindata/testdata/in/c/test.asset
  34. 1
      vendor/github.com/go-bindata/go-bindata/testdata/in/test.asset
  35. 311
      vendor/github.com/go-bindata/go-bindata/testdata/out/compress-memcopy.go
  36. 311
      vendor/github.com/go-bindata/go-bindata/testdata/out/compress-nomemcopy.go
  37. 262
      vendor/github.com/go-bindata/go-bindata/testdata/out/debug.go
  38. 259
      vendor/github.com/go-bindata/go-bindata/testdata/out/debug.go-bindata
  39. 280
      vendor/github.com/go-bindata/go-bindata/testdata/out/nocompress-memcopy.go
  40. 301
      vendor/github.com/go-bindata/go-bindata/testdata/out/nocompress-nomemcopy.go
  41. 1
      vendor/github.com/go-bindata/go-bindata/testdata/symlinkFile/file1
  42. 1
      vendor/github.com/go-bindata/go-bindata/testdata/symlinkParent/symlinkTarget
  43. 1
      vendor/github.com/go-bindata/go-bindata/testdata/symlinkRecursiveParent/file1
  44. 1
      vendor/github.com/go-bindata/go-bindata/testdata/symlinkRecursiveParent/symlinkTarget
  45. 1
      vendor/github.com/go-bindata/go-bindata/testdata/symlinkSrc/file1
  46. 1
      vendor/github.com/go-bindata/go-bindata/testdata/symlinkSrc/file2
  47. 1
      vendor/github.com/go-bindata/go-bindata/testdata/symlinkSrc/file3
  48. 1
      vendor/github.com/go-bindata/go-bindata/testdata/symlinkSrc/file4
  49. 70
      vendor/github.com/go-bindata/go-bindata/toc.go

2
pkg/codegen/main.go

@ -3,7 +3,7 @@ package main
import ( import (
"os" "os"
bindata "github.com/jteeuwen/go-bindata" bindata "github.com/go-bindata/go-bindata"
v1 "github.com/rancher/k3s/pkg/apis/k3s.cattle.io/v1" v1 "github.com/rancher/k3s/pkg/apis/k3s.cattle.io/v1"
controllergen "github.com/rancher/wrangler/pkg/controller-gen" controllergen "github.com/rancher/wrangler/pkg/controller-gen"
"github.com/rancher/wrangler/pkg/controller-gen/args" "github.com/rancher/wrangler/pkg/controller-gen/args"

17
pkg/deploy/zz_generated_bindata.go

@ -1,10 +1,8 @@
// Code generated by go-bindata. // Code generated for package deploy by go-bindata DO NOT EDIT. (@generated)
// sources: // sources:
// manifests/coredns.yaml // manifests/coredns.yaml
// manifests/rolebindings.yaml // manifests/rolebindings.yaml
// manifests/traefik.yaml // manifests/traefik.yaml
// DO NOT EDIT!
package deploy package deploy
import ( import (
@ -51,21 +49,32 @@ type bindataFileInfo struct {
modTime time.Time modTime time.Time
} }
// Name return file name
func (fi bindataFileInfo) Name() string { func (fi bindataFileInfo) Name() string {
return fi.name return fi.name
} }
// Size return file size
func (fi bindataFileInfo) Size() int64 { func (fi bindataFileInfo) Size() int64 {
return fi.size return fi.size
} }
// Mode return file mode
func (fi bindataFileInfo) Mode() os.FileMode { func (fi bindataFileInfo) Mode() os.FileMode {
return fi.mode return fi.mode
} }
// Mode return file modify time
func (fi bindataFileInfo) ModTime() time.Time { func (fi bindataFileInfo) ModTime() time.Time {
return fi.modTime return fi.modTime
} }
// IsDir return file whether a directory
func (fi bindataFileInfo) IsDir() bool { func (fi bindataFileInfo) IsDir() bool {
return false return fi.mode&os.ModeDir != 0
} }
// Sys return file is sys mode
func (fi bindataFileInfo) Sys() interface{} { func (fi bindataFileInfo) Sys() interface{} {
return nil return nil
} }

17
pkg/openapi/zz_generated_bindata.go

@ -1,9 +1,7 @@
// Code generated by go-bindata. // Code generated for package openapi by go-bindata DO NOT EDIT. (@generated)
// sources: // sources:
// vendor/k8s.io/kubernetes/openapi.json // vendor/k8s.io/kubernetes/openapi.json
// vendor/k8s.io/kubernetes/openapi.pb // vendor/k8s.io/kubernetes/openapi.pb
// DO NOT EDIT!
package openapi package openapi
import ( import (
@ -50,21 +48,32 @@ type bindataFileInfo struct {
modTime time.Time modTime time.Time
} }
// Name return file name
func (fi bindataFileInfo) Name() string { func (fi bindataFileInfo) Name() string {
return fi.name return fi.name
} }
// Size return file size
func (fi bindataFileInfo) Size() int64 { func (fi bindataFileInfo) Size() int64 {
return fi.size return fi.size
} }
// Mode return file mode
func (fi bindataFileInfo) Mode() os.FileMode { func (fi bindataFileInfo) Mode() os.FileMode {
return fi.mode return fi.mode
} }
// Mode return file modify time
func (fi bindataFileInfo) ModTime() time.Time { func (fi bindataFileInfo) ModTime() time.Time {
return fi.modTime return fi.modTime
} }
// IsDir return file whether a directory
func (fi bindataFileInfo) IsDir() bool { func (fi bindataFileInfo) IsDir() bool {
return false return fi.mode&os.ModeDir != 0
} }
// Sys return file is sys mode
func (fi bindataFileInfo) Sys() interface{} { func (fi bindataFileInfo) Sys() interface{} {
return nil return nil
} }

17
pkg/static/zz_generated_bindata.go

@ -1,8 +1,6 @@
// Code generated by go-bindata. // Code generated for package static by go-bindata DO NOT EDIT. (@generated)
// sources: // sources:
// build/static/charts/traefik-1.64.0.tgz // build/static/charts/traefik-1.64.0.tgz
// DO NOT EDIT!
package static package static
import ( import (
@ -49,21 +47,32 @@ type bindataFileInfo struct {
modTime time.Time modTime time.Time
} }
// Name return file name
func (fi bindataFileInfo) Name() string { func (fi bindataFileInfo) Name() string {
return fi.name return fi.name
} }
// Size return file size
func (fi bindataFileInfo) Size() int64 { func (fi bindataFileInfo) Size() int64 {
return fi.size return fi.size
} }
// Mode return file mode
func (fi bindataFileInfo) Mode() os.FileMode { func (fi bindataFileInfo) Mode() os.FileMode {
return fi.mode return fi.mode
} }
// Mode return file modify time
func (fi bindataFileInfo) ModTime() time.Time { func (fi bindataFileInfo) ModTime() time.Time {
return fi.modTime return fi.modTime
} }
// IsDir return file whether a directory
func (fi bindataFileInfo) IsDir() bool { func (fi bindataFileInfo) IsDir() bool {
return false return fi.mode&os.ModeDir != 0
} }
// Sys return file is sys mode
func (fi bindataFileInfo) Sys() interface{} { func (fi bindataFileInfo) Sys() interface{} {
return nil return nil
} }

4
trash.lock

@ -156,8 +156,8 @@ import:
version: 72f9bd7c4e0c2a40055ab3d0f09654f730cce982 version: 72f9bd7c4e0c2a40055ab3d0f09654f730cce982
- package: github.com/json-iterator/go - package: github.com/json-iterator/go
version: 1.1.5 version: 1.1.5
- package: github.com/jteeuwen/go-bindata - package: github.com/go-bindata/go-bindata
version: v3.0.7-72-ga0ff2567cfb709 version: v3.1.2
- package: github.com/karrick/godirwalk - package: github.com/karrick/godirwalk
version: v1.7.5 version: v1.7.5
- package: github.com/kubernetes-sigs/cri-tools - package: github.com/kubernetes-sigs/cri-tools

4
vendor.conf

@ -1,6 +1,6 @@
package=github.com/rancher/k3s package=github.com/rancher/k3s
package=github.com/jteeuwen/go-bindata package=github.com/go-bindata/go-bindata
package=github.com/jteeuwen/go-bindata/go-bindata package=github.com/go-bindata/go-bindata/go-bindata
package=github.com/containerd/containerd/cmd/containerd-shim package=github.com/containerd/containerd/cmd/containerd-shim
package=k8s.io/kubernetes/cmd/hyperkube package=k8s.io/kubernetes/cmd/hyperkube
package=github.com/opencontainers/runc package=github.com/opencontainers/runc

16
vendor/github.com/go-bindata/go-bindata/.gitignore generated vendored

@ -0,0 +1,16 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, build with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Goland project files
.idea/
*.iml

0
vendor/github.com/jteeuwen/go-bindata/CONTRIBUTING.md → vendor/github.com/go-bindata/go-bindata/CONTRIBUTING.md generated vendored

0
vendor/github.com/jteeuwen/go-bindata/LICENSE → vendor/github.com/go-bindata/go-bindata/LICENSE generated vendored

0
vendor/github.com/jteeuwen/go-bindata/Makefile → vendor/github.com/go-bindata/go-bindata/Makefile generated vendored

18
vendor/github.com/jteeuwen/go-bindata/README.md → vendor/github.com/go-bindata/go-bindata/README.md generated vendored

@ -1,5 +1,7 @@
## bindata ## bindata
[![Go Report Card](https://goreportcard.com/badge/github.com/go-bindata/bindata)](https://goreportcard.com/report/github.com/go-bindata/bindata)
This package converts any file into managable Go source code. Useful for This package converts any file into managable Go source code. Useful for
embedding binary data into a go program. The file data is optionally gzip embedding binary data into a go program. The file data is optionally gzip
compressed before being converted to a raw byte slice. compressed before being converted to a raw byte slice.
@ -13,7 +15,7 @@ output being generated.
To install the library and command line program, use the following: To install the library and command line program, use the following:
go get -u github.com/jteeuwen/go-bindata/... go get -u github.com/go-bindata/go-bindata/...
### Usage ### Usage
@ -182,8 +184,16 @@ format is specified at build time with the appropriate tags.
The tags are appended to a `// +build` line in the beginning of the output file The tags are appended to a `// +build` line in the beginning of the output file
and must follow the build tags syntax specified by the go tool. and must follow the build tags syntax specified by the go tool.
### Related projects ### Serve assets with `net/http`
With the `-fs` flag, `go-bindata` will add an `AssetFile()` method returning an `http.FileSystem` interface:
$ go-bindata -fs -prefix "static/" static/
[go-bindata-assetfs](https://github.com/elazarl/go-bindata-assetfs#readme) - Use `-prefix` flag to strip first level dir, then in your `net/http` router, you can use `AssetFile()` with `http.FileServer()` like:
implements `http.FileSystem` interface. Allows you to serve assets with `net/http`.
```go
mux := http.NewServeMux()
mux.Handle("/static", http.FileServer(AssetFile()))
http.ListenAndServe(":8080", mux)
```

1
vendor/github.com/go-bindata/go-bindata/_config.yml generated vendored

@ -0,0 +1 @@
theme: jekyll-theme-cayman

0
vendor/github.com/jteeuwen/go-bindata/asset.go → vendor/github.com/go-bindata/go-bindata/asset.go generated vendored

0
vendor/github.com/jteeuwen/go-bindata/bytewriter.go → vendor/github.com/go-bindata/go-bindata/bytewriter.go generated vendored

5
vendor/github.com/jteeuwen/go-bindata/config.go → vendor/github.com/go-bindata/go-bindata/config.go generated vendored

@ -106,6 +106,10 @@ type Config struct {
// the file data when called. Defaults to false. // the file data when called. Defaults to false.
NoCompress bool NoCompress bool
// HttpFileSystem means whether generate return http.FileSystem interface
// instance's function.When true,will generate relate code.
HttpFileSystem bool
// Perform a debug build. This generates an asset file, which // Perform a debug build. This generates an asset file, which
// loads the asset contents directly from disk at their original // loads the asset contents directly from disk at their original
// location, instead of embedding the contents in the code. // location, instead of embedding the contents in the code.
@ -148,6 +152,7 @@ func NewConfig() *Config {
c.Package = "main" c.Package = "main"
c.NoMemCopy = false c.NoMemCopy = false
c.NoCompress = false c.NoCompress = false
c.HttpFileSystem = false
c.Debug = false c.Debug = false
c.Output = "./bindata.go" c.Output = "./bindata.go"
c.Ignore = make([]*regexp.Regexp, 0) c.Ignore = make([]*regexp.Regexp, 0)

10
vendor/github.com/jteeuwen/go-bindata/convert.go → vendor/github.com/go-bindata/go-bindata/convert.go generated vendored

@ -50,7 +50,7 @@ func Translate(c *Config) error {
defer bfd.Flush() defer bfd.Flush()
// Write the header. This makes e.g. Github ignore diffs in generated files. // Write the header. This makes e.g. Github ignore diffs in generated files.
if _, err = fmt.Fprint(bfd, "// Code generated by go-bindata.\n"); err != nil { if _, err = fmt.Fprintf(bfd, "// Code generated for package %s by go-bindata DO NOT EDIT. (@generated)\n", c.Package); err != nil {
return err return err
} }
if _, err = fmt.Fprint(bfd, "// sources:\n"); err != nil { if _, err = fmt.Fprint(bfd, "// sources:\n"); err != nil {
@ -68,9 +68,9 @@ func Translate(c *Config) error {
return err return err
} }
} }
if _, err = fmt.Fprint(bfd, "// DO NOT EDIT!\n\n"); err != nil { //if _, err = fmt.Fprint(bfd, "// DO NOT EDIT!\n\n"); err != nil {
return err // return err
} //}
// Write build tags, if applicable. // Write build tags, if applicable.
if len(c.Tags) > 0 { if len(c.Tags) > 0 {
@ -109,7 +109,7 @@ func Translate(c *Config) error {
return writeRestore(bfd) return writeRestore(bfd)
} }
// Implement sort.Interface for []os.FileInfo based on Name() // ByName implements sort.Interface for []os.FileInfo based on Name()
type ByName []os.FileInfo type ByName []os.FileInfo
func (v ByName) Len() int { return len(v) } func (v ByName) Len() int { return len(v) }

90
vendor/github.com/go-bindata/go-bindata/convert_test.go generated vendored

@ -0,0 +1,90 @@
package bindata
import (
"regexp"
"strings"
"testing"
)
func TestSafeFunctionName(t *testing.T) {
var knownFuncs = make(map[string]int)
name1 := safeFunctionName("foo/bar", knownFuncs)
name2 := safeFunctionName("foo_bar", knownFuncs)
if name1 == name2 {
t.Errorf("name collision")
}
}
func TestFindFiles(t *testing.T) {
var toc []Asset
var knownFuncs = make(map[string]int)
var visitedPaths = make(map[string]bool)
err := findFiles("testdata/dupname", "testdata/dupname", true, &toc, []*regexp.Regexp{}, knownFuncs, visitedPaths)
if err != nil {
t.Errorf("expected to be no error: %+v", err)
}
if toc[0].Func == toc[1].Func {
t.Errorf("name collision")
}
}
func TestFindFilesWithSymlinks(t *testing.T) {
var tocSrc []Asset
var tocTarget []Asset
var knownFuncs = make(map[string]int)
var visitedPaths = make(map[string]bool)
err := findFiles("testdata/symlinkSrc", "testdata/symlinkSrc", true, &tocSrc, []*regexp.Regexp{}, knownFuncs, visitedPaths)
if err != nil {
t.Errorf("expected to be no error: %+v", err)
}
knownFuncs = make(map[string]int)
visitedPaths = make(map[string]bool)
err = findFiles("testdata/symlinkParent", "testdata/symlinkParent", true, &tocTarget, []*regexp.Regexp{}, knownFuncs, visitedPaths)
if err != nil {
t.Errorf("expected to be no error: %+v", err)
}
if len(tocSrc) != len(tocTarget) {
t.Errorf("Symlink source and target should have the same number of assets. Expected %d got %d", len(tocTarget), len(tocSrc))
} else {
for i, _ := range tocSrc {
targetFunc := strings.TrimPrefix(tocTarget[i].Func, "symlinktarget")
targetFunc = strings.ToLower(targetFunc[:1]) + targetFunc[1:]
if tocSrc[i].Func != targetFunc {
t.Errorf("Symlink source and target produced different function lists. Expected %s to be %s", targetFunc, tocSrc[i].Func)
}
}
}
}
func TestFindFilesWithRecursiveSymlinks(t *testing.T) {
var toc []Asset
var knownFuncs = make(map[string]int)
var visitedPaths = make(map[string]bool)
err := findFiles("testdata/symlinkRecursiveParent", "testdata/symlinkRecursiveParent", true, &toc, []*regexp.Regexp{}, knownFuncs, visitedPaths)
if err != nil {
t.Errorf("expected to be no error: %+v", err)
}
if len(toc) != 1 {
t.Errorf("Only one asset should have been found. Got %d: %v", len(toc), toc)
}
}
func TestFindFilesWithSymlinkedFile(t *testing.T) {
var toc []Asset
var knownFuncs = make(map[string]int)
var visitedPaths = make(map[string]bool)
err := findFiles("testdata/symlinkFile", "testdata/symlinkFile", true, &toc, []*regexp.Regexp{}, knownFuncs, visitedPaths)
if err != nil {
t.Errorf("expected to be no error: %+v", err)
}
if len(toc) != 1 {
t.Errorf("Only one asset should have been found. Got %d: %v", len(toc), toc)
}
}

29
vendor/github.com/jteeuwen/go-bindata/debug.go → vendor/github.com/go-bindata/go-bindata/debug.go generated vendored

@ -11,7 +11,12 @@ import (
// writeDebug writes the debug code file. // writeDebug writes the debug code file.
func writeDebug(w io.Writer, c *Config, toc []Asset) error { func writeDebug(w io.Writer, c *Config, toc []Asset) error {
err := writeDebugHeader(w) err := writeDebugHeader(w, c)
if err != nil {
return err
}
err = writeAssetFS(w, c)
if err != nil { if err != nil {
return err return err
} }
@ -28,13 +33,29 @@ func writeDebug(w io.Writer, c *Config, toc []Asset) error {
// writeDebugHeader writes output file headers. // writeDebugHeader writes output file headers.
// This targets debug builds. // This targets debug builds.
func writeDebugHeader(w io.Writer) error { func writeDebugHeader(w io.Writer, c *Config) error {
_, err := fmt.Fprintf(w, `import ( var header string
if c.HttpFileSystem {
header = `import (
"bytes"
"net/http"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
"time"`
} else {
header = `import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"`
}
_, err := fmt.Fprintf(w, `%s
) )
// bindataRead reads the given file from disk. It returns an error on failure. // bindataRead reads the given file from disk. It returns an error on failure.
@ -51,7 +72,7 @@ type asset struct {
info os.FileInfo info os.FileInfo
} }
`) `, header)
return err return err
} }

0
vendor/github.com/jteeuwen/go-bindata/doc.go → vendor/github.com/go-bindata/go-bindata/doc.go generated vendored

102
vendor/github.com/go-bindata/go-bindata/file.go generated vendored

@ -0,0 +1,102 @@
package bindata
import (
"fmt"
"io"
)
func writeAssetFS(w io.Writer, c *Config) error {
if !c.HttpFileSystem {
return nil
}
_, err := fmt.Fprintf(w, `
type assetFile struct {
*bytes.Reader
name string
childInfos []os.FileInfo
childInfoOffset int
}
type assetOperator struct{}
// Open implement http.FileSystem interface
func (f *assetOperator) Open(name string) (http.File, error) {
var err error
if len(name) > 0 && name[0] == '/' {
name = name[1:]
}
content, err := Asset(name)
if err == nil {
return &assetFile{name: name, Reader: bytes.NewReader(content)}, nil
}
children, err := AssetDir(name)
if err == nil {
childInfos := make([]os.FileInfo, 0, len(children))
for _, child := range children {
childPath := filepath.Join(name, child)
info, errInfo := AssetInfo(filepath.Join(name, child))
if errInfo == nil {
childInfos = append(childInfos, info)
} else {
childInfos = append(childInfos, newDirFileInfo(childPath))
}
}
return &assetFile{name: name, childInfos: childInfos}, nil
} else {
// If the error is not found, return an error that will
// result in a 404 error. Otherwise the server returns
// a 500 error for files not found.
if strings.Contains(err.Error(), "not found") {
return nil, os.ErrNotExist
}
return nil, err
}
}
// Close no need do anything
func (f *assetFile) Close() error {
return nil
}
// Readdir read dir's children file info
func (f *assetFile) Readdir(count int) ([]os.FileInfo, error) {
if len(f.childInfos) == 0 {
return nil, os.ErrNotExist
}
if count <= 0 {
return f.childInfos, nil
}
if f.childInfoOffset+count > len(f.childInfos) {
count = len(f.childInfos) - f.childInfoOffset
}
offset := f.childInfoOffset
f.childInfoOffset += count
return f.childInfos[offset : offset+count], nil
}
// Stat read file info from asset item
func (f *assetFile) Stat() (os.FileInfo, error) {
if len(f.childInfos) != 0 {
return newDirFileInfo(f.name), nil
}
return AssetInfo(f.name)
}
// newDirFileInfo return default dir file info
func newDirFileInfo(name string) os.FileInfo {
return &bindataFileInfo{
name: name,
size: 0,
mode: os.FileMode(2147484068), // equal os.FileMode(0644)|os.ModeDir
modTime: time.Time{}}
}
// AssetFile return a http.FileSystem instance that data backend by asset
func AssetFile() http.FileSystem {
return &assetOperator{}
}
`)
return err
}

1
vendor/github.com/go-bindata/go-bindata/go-bindata/.gitignore generated vendored

@ -0,0 +1 @@
go-bindata

0
vendor/github.com/jteeuwen/go-bindata/go-bindata/AppendSliceValue.go → vendor/github.com/go-bindata/go-bindata/go-bindata/AppendSliceValue.go generated vendored

3
vendor/github.com/jteeuwen/go-bindata/go-bindata/main.go → vendor/github.com/go-bindata/go-bindata/go-bindata/main.go generated vendored

@ -12,7 +12,7 @@ import (
"regexp" "regexp"
"strings" "strings"
"github.com/jteeuwen/go-bindata" "github.com/go-bindata/go-bindata"
) )
func main() { func main() {
@ -48,6 +48,7 @@ func parseArgs() *bindata.Config {
flag.BoolVar(&c.NoMemCopy, "nomemcopy", c.NoMemCopy, "Use a .rodata hack to get rid of unnecessary memcopies. Refer to the documentation to see what implications this carries.") flag.BoolVar(&c.NoMemCopy, "nomemcopy", c.NoMemCopy, "Use a .rodata hack to get rid of unnecessary memcopies. Refer to the documentation to see what implications this carries.")
flag.BoolVar(&c.NoCompress, "nocompress", c.NoCompress, "Assets will *not* be GZIP compressed when this flag is specified.") flag.BoolVar(&c.NoCompress, "nocompress", c.NoCompress, "Assets will *not* be GZIP compressed when this flag is specified.")
flag.BoolVar(&c.NoMetadata, "nometadata", c.NoMetadata, "Assets will not preserve size, mode, and modtime info.") flag.BoolVar(&c.NoMetadata, "nometadata", c.NoMetadata, "Assets will not preserve size, mode, and modtime info.")
flag.BoolVar(&c.HttpFileSystem, "fs", c.HttpFileSystem, "Whether generate instance http.FileSystem interface code.")
flag.UintVar(&c.Mode, "mode", c.Mode, "Optional file mode override for all files.") flag.UintVar(&c.Mode, "mode", c.Mode, "Optional file mode override for all files.")
flag.Int64Var(&c.ModTime, "modtime", c.ModTime, "Optional modification unix timestamp override for all files.") flag.Int64Var(&c.ModTime, "modtime", c.ModTime, "Optional modification unix timestamp override for all files.")
flag.StringVar(&c.Output, "o", c.Output, "Optional name of the output file to be generated.") flag.StringVar(&c.Output, "o", c.Output, "Optional name of the output file to be generated.")

2
vendor/github.com/jteeuwen/go-bindata/go-bindata/version.go → vendor/github.com/go-bindata/go-bindata/go-bindata/version.go generated vendored

@ -23,7 +23,7 @@ var AppVersionRev string
func Version() string { func Version() string {
if len(AppVersionRev) == 0 { if len(AppVersionRev) == 0 {
AppVersionRev = "0" AppVersionRev = "2"
} }
return fmt.Sprintf("%s %d.%d.%s (Go runtime %s).\nCopyright (c) 2010-2013, Jim Teeuwen.", return fmt.Sprintf("%s %d.%d.%s (Go runtime %s).\nCopyright (c) 2010-2013, Jim Teeuwen.",

128
vendor/github.com/jteeuwen/go-bindata/release.go → vendor/github.com/go-bindata/go-bindata/release.go generated vendored

@ -21,6 +21,11 @@ func writeRelease(w io.Writer, c *Config, toc []Asset) error {
return err return err
} }
err = writeAssetFS(w, c)
if err != nil {
return err
}
for i := range toc { for i := range toc {
err = writeReleaseAsset(w, c, &toc[i]) err = writeReleaseAsset(w, c, &toc[i])
if err != nil { if err != nil {
@ -37,15 +42,15 @@ func writeReleaseHeader(w io.Writer, c *Config) error {
var err error var err error
if c.NoCompress { if c.NoCompress {
if c.NoMemCopy { if c.NoMemCopy {
err = header_uncompressed_nomemcopy(w) err = header_uncompressed_nomemcopy(w, c)
} else { } else {
err = header_uncompressed_memcopy(w) err = header_uncompressed_memcopy(w, c)
} }
} else { } else {
if c.NoMemCopy { if c.NoMemCopy {
err = header_compressed_nomemcopy(w) err = header_compressed_nomemcopy(w, c)
} else { } else {
err = header_compressed_memcopy(w) err = header_compressed_memcopy(w, c)
} }
} }
if err != nil { if err != nil {
@ -97,17 +102,35 @@ func sanitize(b []byte) []byte {
return bytes.Replace(b, []byte("\xEF\xBB\xBF"), []byte("`+\"\\xEF\\xBB\\xBF\"+`"), -1) return bytes.Replace(b, []byte("\xEF\xBB\xBF"), []byte("`+\"\\xEF\\xBB\\xBF\"+`"), -1)
} }
func header_compressed_nomemcopy(w io.Writer) error { func header_compressed_nomemcopy(w io.Writer, c *Config) error {
_, err := fmt.Fprintf(w, `import ( var header string
if c.HttpFileSystem {
header = `import (
"bytes" "bytes"
"compress/gzip" "compress/gzip"
"fmt" "fmt"
"net/http"
"io" "io"
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
"time" "time"`
} else {
header = `import (
"bytes"
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"`
}
_, err := fmt.Fprintf(w, `%s
) )
func bindataRead(data, name string) ([]byte, error) { func bindataRead(data, name string) ([]byte, error) {
@ -130,21 +153,39 @@ func bindataRead(data, name string) ([]byte, error) {
return buf.Bytes(), nil return buf.Bytes(), nil
} }
`) `, header)
return err return err
} }
func header_compressed_memcopy(w io.Writer) error { func header_compressed_memcopy(w io.Writer, c *Config) error {
_, err := fmt.Fprintf(w, `import ( var header string
if c.HttpFileSystem {
header = `import (
"bytes" "bytes"
"compress/gzip" "compress/gzip"
"fmt" "fmt"
"net/http"
"io" "io"
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
"time" "time"`
} else {
header = `import (
"bytes"
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"`
}
_, err := fmt.Fprintf(w, `%s
) )
func bindataRead(data []byte, name string) ([]byte, error) { func bindataRead(data []byte, name string) ([]byte, error) {
@ -167,12 +208,27 @@ func bindataRead(data []byte, name string) ([]byte, error) {
return buf.Bytes(), nil return buf.Bytes(), nil
} }
`) `, header)
return err return err
} }
func header_uncompressed_nomemcopy(w io.Writer) error { func header_uncompressed_nomemcopy(w io.Writer, c *Config) error {
_, err := fmt.Fprintf(w, `import ( var header string
if c.HttpFileSystem {
header = `import (
"bytes"
"fmt"
"net/http"
"io/ioutil"
"os"
"path/filepath"
"reflect"
"strings"
"time"
"unsafe"`
} else {
header = `import (
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"os" "os"
@ -180,7 +236,10 @@ func header_uncompressed_nomemcopy(w io.Writer) error {
"reflect" "reflect"
"strings" "strings"
"time" "time"
"unsafe" "unsafe"`
}
_, err := fmt.Fprintf(w, `%s
) )
func bindataRead(data, name string) ([]byte, error) { func bindataRead(data, name string) ([]byte, error) {
@ -194,20 +253,36 @@ func bindataRead(data, name string) ([]byte, error) {
return b, nil return b, nil
} }
`) `, header)
return err return err
} }
func header_uncompressed_memcopy(w io.Writer) error { func header_uncompressed_memcopy(w io.Writer, c *Config) error {
_, err := fmt.Fprintf(w, `import ( var header string
if c.HttpFileSystem {
header = `import (
"bytes"
"fmt" "fmt"
"net/http"
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
"time" "time"`
} else {
header = `import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"`
}
_, err := fmt.Fprintf(w, `%s
) )
`) `, header)
return err return err
} }
@ -224,21 +299,32 @@ type bindataFileInfo struct {
modTime time.Time modTime time.Time
} }
// Name return file name
func (fi bindataFileInfo) Name() string { func (fi bindataFileInfo) Name() string {
return fi.name return fi.name
} }
// Size return file size
func (fi bindataFileInfo) Size() int64 { func (fi bindataFileInfo) Size() int64 {
return fi.size return fi.size
} }
// Mode return file mode
func (fi bindataFileInfo) Mode() os.FileMode { func (fi bindataFileInfo) Mode() os.FileMode {
return fi.mode return fi.mode
} }
// Mode return file modify time
func (fi bindataFileInfo) ModTime() time.Time { func (fi bindataFileInfo) ModTime() time.Time {
return fi.modTime return fi.modTime
} }
// IsDir return file whether a directory
func (fi bindataFileInfo) IsDir() bool { func (fi bindataFileInfo) IsDir() bool {
return false return fi.mode&os.ModeDir != 0
} }
// Sys return file is sys mode
func (fi bindataFileInfo) Sys() interface{} { func (fi bindataFileInfo) Sys() interface{} {
return nil return nil
} }

1
vendor/github.com/jteeuwen/go-bindata/restore.go → vendor/github.com/go-bindata/go-bindata/restore.go generated vendored

@ -57,7 +57,6 @@ func _filePath(dir, name string) string {
cannonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
} }
`) `)
return err return err
} }

0
vendor/github.com/jteeuwen/go-bindata/stringwriter.go → vendor/github.com/go-bindata/go-bindata/stringwriter.go generated vendored

33
vendor/github.com/go-bindata/go-bindata/testdata/Makefile generated vendored

@ -0,0 +1,33 @@
FILES:=$(wildcard out/*.go)
.PHONY: check
check: errcheck golint $(FILES:.go=.checked)
out/%.checked: out/%.go
errcheck $<
go vet --all $<
golint $<
$(GOPATH)/bin/go-bindata: $(wildcard ../*.go) $(wildcard ../**/*.go)
go install ../...
out/compress-memcopy.go: $(wildcard in/**/*) $(GOPATH)/bin/go-bindata
$(GOPATH)/bin/go-bindata -o $@ in/...
out/compress-nomemcopy.go: $(wildcard in/**/*) $(GOPATH)/bin/go-bindata
$(GOPATH)/bin/go-bindata -nomemcopy -o $@ in/...
out/debug.go: $(wildcard in/**/*) $(GOPATH)/bin/go-bindata
$(GOPATH)/bin/go-bindata -debug -o $@ in/...
out/nocompress-memcopy.go: $(wildcard in/**/*) $(GOPATH)/bin/go-bindata
$(GOPATH)/bin/go-bindata -nocompress -o $@ in/...
out/nocompress-nomemcopy.go: $(wildcard in/**/*) $(GOPATH)/bin/go-bindata
$(GOPATH)/bin/go-bindata -nocompress -nomemcopy -o $@ in/...
errcheck:
go get github.com/kisielk/errcheck
golint:
go get golang.org/x/lint/golint

1
vendor/github.com/go-bindata/go-bindata/testdata/dupname/foo/bar generated vendored

@ -0,0 +1 @@
// sample file

1
vendor/github.com/go-bindata/go-bindata/testdata/dupname/foo_bar generated vendored

@ -0,0 +1 @@
// sample file

1
vendor/github.com/go-bindata/go-bindata/testdata/in/a/test.asset generated vendored

@ -0,0 +1 @@
// sample file

1
vendor/github.com/go-bindata/go-bindata/testdata/in/b/test.asset generated vendored

@ -0,0 +1 @@
// sample file

1
vendor/github.com/go-bindata/go-bindata/testdata/in/c/test.asset generated vendored

@ -0,0 +1 @@
// sample file

1
vendor/github.com/go-bindata/go-bindata/testdata/in/test.asset generated vendored

@ -0,0 +1 @@
// sample file

311
vendor/github.com/go-bindata/go-bindata/testdata/out/compress-memcopy.go generated vendored

@ -0,0 +1,311 @@
// Code generated for package main by go-bindata DO NOT EDIT.
// sources:
// in/a/test.asset
// in/b/test.asset
// in/c/test.asset
// in/test.asset
package main
import (
"bytes"
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"
)
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)
}
var buf bytes.Buffer
_, err = io.Copy(&buf, gz)
clErr := gz.Close()
if err != nil {
return nil, fmt.Errorf("Read %q: %v", name, err)
}
if clErr != nil {
return nil, err
}
return buf.Bytes(), nil
}
type asset struct {
bytes []byte
info os.FileInfo
}
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 _inATestAsset = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00")
func inATestAssetBytes() ([]byte, error) {
return bindataRead(
_inATestAsset,
"in/a/test.asset",
)
}
func inATestAsset() (*asset, error) {
bytes, err := inATestAssetBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "in/a/test.asset", size: 15, mode: os.FileMode(436), modTime: time.Unix(1445582844, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _inBTestAsset = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00")
func inBTestAssetBytes() ([]byte, error) {
return bindataRead(
_inBTestAsset,
"in/b/test.asset",
)
}
func inBTestAsset() (*asset, error) {
bytes, err := inBTestAssetBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "in/b/test.asset", size: 15, mode: os.FileMode(436), modTime: time.Unix(1445582844, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _inCTestAsset = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00")
func inCTestAssetBytes() ([]byte, error) {
return bindataRead(
_inCTestAsset,
"in/c/test.asset",
)
}
func inCTestAsset() (*asset, error) {
bytes, err := inCTestAssetBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "in/c/test.asset", size: 15, mode: os.FileMode(436), modTime: time.Unix(1445582844, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _inTestAsset = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00")
func inTestAssetBytes() ([]byte, error) {
return bindataRead(
_inTestAsset,
"in/test.asset",
)
}
func inTestAsset() (*asset, error) {
bytes, err := inTestAssetBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "in/test.asset", size: 15, mode: os.FileMode(436), modTime: time.Unix(1445582844, 0)}
a := &asset{bytes: bytes, info: info}
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 {
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)
}
// 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
}
// 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 {
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)
}
// AssetNames returns the names of the assets.
func AssetNames() []string {
names := make([]string, 0, len(_bindata))
for name := range _bindata {
names = append(names, name)
}
return names
}
// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
"in/a/test.asset": inATestAsset,
"in/b/test.asset": inBTestAsset,
"in/c/test.asset": inCTestAsset,
"in/test.asset": inTestAsset,
}
// 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
// following hierarchy:
// data/
// foo.txt
// 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
// 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, "/")
for _, p := range pathList {
node = node.Children[p]
if node == nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
}
}
if node.Func != nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
rv := make([]string, 0, len(node.Children))
for childName := range node.Children {
rv = append(rv, childName)
}
return rv, nil
}
type bintree struct {
Func func() (*asset, error)
Children map[string]*bintree
}
var _bintree = &bintree{nil, map[string]*bintree{
"in": &bintree{nil, map[string]*bintree{
"a": &bintree{nil, map[string]*bintree{
"test.asset": &bintree{inATestAsset, map[string]*bintree{}},
}},
"b": &bintree{nil, map[string]*bintree{
"test.asset": &bintree{inBTestAsset, map[string]*bintree{}},
}},
"c": &bintree{nil, map[string]*bintree{
"test.asset": &bintree{inCTestAsset, map[string]*bintree{}},
}},
"test.asset": &bintree{inTestAsset, 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
}
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
if err != nil {
return err
}
return nil
}
// 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 {
cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}

311
vendor/github.com/go-bindata/go-bindata/testdata/out/compress-nomemcopy.go generated vendored

@ -0,0 +1,311 @@
// Code generated for package main by go-bindata DO NOT EDIT.
// sources:
// in/a/test.asset
// in/b/test.asset
// in/c/test.asset
// in/test.asset
package main
import (
"bytes"
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"
)
func bindataRead(data, name string) ([]byte, error) {
gz, err := gzip.NewReader(strings.NewReader(data))
if err != nil {
return nil, fmt.Errorf("Read %q: %v", name, err)
}
var buf bytes.Buffer
_, err = io.Copy(&buf, gz)
clErr := gz.Close()
if err != nil {
return nil, fmt.Errorf("Read %q: %v", name, err)
}
if clErr != nil {
return nil, err
}
return buf.Bytes(), nil
}
type asset struct {
bytes []byte
info os.FileInfo
}
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 _inATestAsset = "\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00"
func inATestAssetBytes() ([]byte, error) {
return bindataRead(
_inATestAsset,
"in/a/test.asset",
)
}
func inATestAsset() (*asset, error) {
bytes, err := inATestAssetBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "in/a/test.asset", size: 15, mode: os.FileMode(436), modTime: time.Unix(1445582844, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _inBTestAsset = "\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00"
func inBTestAssetBytes() ([]byte, error) {
return bindataRead(
_inBTestAsset,
"in/b/test.asset",
)
}
func inBTestAsset() (*asset, error) {
bytes, err := inBTestAssetBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "in/b/test.asset", size: 15, mode: os.FileMode(436), modTime: time.Unix(1445582844, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _inCTestAsset = "\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00"
func inCTestAssetBytes() ([]byte, error) {
return bindataRead(
_inCTestAsset,
"in/c/test.asset",
)
}
func inCTestAsset() (*asset, error) {
bytes, err := inCTestAssetBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "in/c/test.asset", size: 15, mode: os.FileMode(436), modTime: time.Unix(1445582844, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _inTestAsset = "\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00"
func inTestAssetBytes() ([]byte, error) {
return bindataRead(
_inTestAsset,
"in/test.asset",
)
}
func inTestAsset() (*asset, error) {
bytes, err := inTestAssetBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "in/test.asset", size: 15, mode: os.FileMode(436), modTime: time.Unix(1445582844, 0)}
a := &asset{bytes: bytes, info: info}
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 {
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)
}
// 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
}
// 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 {
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)
}
// AssetNames returns the names of the assets.
func AssetNames() []string {
names := make([]string, 0, len(_bindata))
for name := range _bindata {
names = append(names, name)
}
return names
}
// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
"in/a/test.asset": inATestAsset,
"in/b/test.asset": inBTestAsset,
"in/c/test.asset": inCTestAsset,
"in/test.asset": inTestAsset,
}
// 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
// following hierarchy:
// data/
// foo.txt
// 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
// 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, "/")
for _, p := range pathList {
node = node.Children[p]
if node == nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
}
}
if node.Func != nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
rv := make([]string, 0, len(node.Children))
for childName := range node.Children {
rv = append(rv, childName)
}
return rv, nil
}
type bintree struct {
Func func() (*asset, error)
Children map[string]*bintree
}
var _bintree = &bintree{nil, map[string]*bintree{
"in": &bintree{nil, map[string]*bintree{
"a": &bintree{nil, map[string]*bintree{
"test.asset": &bintree{inATestAsset, map[string]*bintree{}},
}},
"b": &bintree{nil, map[string]*bintree{
"test.asset": &bintree{inBTestAsset, map[string]*bintree{}},
}},
"c": &bintree{nil, map[string]*bintree{
"test.asset": &bintree{inCTestAsset, map[string]*bintree{}},
}},
"test.asset": &bintree{inTestAsset, 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
}
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
if err != nil {
return err
}
return nil
}
// 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 {
cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}

262
vendor/github.com/go-bindata/go-bindata/testdata/out/debug.go generated vendored

@ -0,0 +1,262 @@
// Code generated for package main by go-bindata DO NOT EDIT.
// sources:
// in/a/test.asset
// in/b/test.asset
// in/c/test.asset
// in/test.asset
package main
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
)
// bindataRead reads the given file from disk. It returns an error on failure.
func bindataRead(path, name string) ([]byte, error) {
buf, err := ioutil.ReadFile(path)
if err != nil {
err = fmt.Errorf("Error reading asset %s at %s: %v", name, path, err)
}
return buf, err
}
type asset struct {
bytes []byte
info os.FileInfo
}
// inATestAsset reads file data from disk. It returns an error on failure.
func inATestAsset() (*asset, error) {
path := "/home/ts/code/go/src/github.com/jteeuwen/go-bindata/testdata/in/a/test.asset"
name := "in/a/test.asset"
bytes, err := bindataRead(path, name)
if err != nil {
return nil, err
}
fi, err := os.Stat(path)
if err != nil {
err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err)
}
a := &asset{bytes: bytes, info: fi}
return a, err
}
// inBTestAsset reads file data from disk. It returns an error on failure.
func inBTestAsset() (*asset, error) {
path := "/home/ts/code/go/src/github.com/jteeuwen/go-bindata/testdata/in/b/test.asset"
name := "in/b/test.asset"
bytes, err := bindataRead(path, name)
if err != nil {
return nil, err
}
fi, err := os.Stat(path)
if err != nil {
err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err)
}
a := &asset{bytes: bytes, info: fi}
return a, err
}
// inCTestAsset reads file data from disk. It returns an error on failure.
func inCTestAsset() (*asset, error) {
path := "/home/ts/code/go/src/github.com/jteeuwen/go-bindata/testdata/in/c/test.asset"
name := "in/c/test.asset"
bytes, err := bindataRead(path, name)
if err != nil {
return nil, err
}
fi, err := os.Stat(path)
if err != nil {
err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err)
}
a := &asset{bytes: bytes, info: fi}
return a, err
}
// inTestAsset reads file data from disk. It returns an error on failure.
func inTestAsset() (*asset, error) {
path := "/home/ts/code/go/src/github.com/jteeuwen/go-bindata/testdata/in/test.asset"
name := "in/test.asset"
bytes, err := bindataRead(path, name)
if err != nil {
return nil, err
}
fi, err := os.Stat(path)
if err != nil {
err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err)
}
a := &asset{bytes: bytes, info: fi}
return a, err
}
// 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 {
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)
}
// 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
}
// 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 {
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)
}
// AssetNames returns the names of the assets.
func AssetNames() []string {
names := make([]string, 0, len(_bindata))
for name := range _bindata {
names = append(names, name)
}
return names
}
// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
"in/a/test.asset": inATestAsset,
"in/b/test.asset": inBTestAsset,
"in/c/test.asset": inCTestAsset,
"in/test.asset": inTestAsset,
}
// 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
// following hierarchy:
// data/
// foo.txt
// 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
// 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, "/")
for _, p := range pathList {
node = node.Children[p]
if node == nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
}
}
if node.Func != nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
rv := make([]string, 0, len(node.Children))
for childName := range node.Children {
rv = append(rv, childName)
}
return rv, nil
}
type bintree struct {
Func func() (*asset, error)
Children map[string]*bintree
}
var _bintree = &bintree{nil, map[string]*bintree{
"in": &bintree{nil, map[string]*bintree{
"a": &bintree{nil, map[string]*bintree{
"test.asset": &bintree{inATestAsset, map[string]*bintree{}},
}},
"b": &bintree{nil, map[string]*bintree{
"test.asset": &bintree{inBTestAsset, map[string]*bintree{}},
}},
"c": &bintree{nil, map[string]*bintree{
"test.asset": &bintree{inCTestAsset, map[string]*bintree{}},
}},
"test.asset": &bintree{inTestAsset, 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
}
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
if err != nil {
return err
}
return nil
}
// 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 {
cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}

259
vendor/github.com/go-bindata/go-bindata/testdata/out/debug.go-bindata generated vendored

@ -0,0 +1,259 @@
package main
import (
"fmt"
"io/ioutil"
"strings"
"os"
"path"
"path/filepath"
)
// bindata_read reads the given file from disk. It returns an error on failure.
func bindata_read(path, name string) ([]byte, error) {
buf, err := ioutil.ReadFile(path)
if err != nil {
err = fmt.Errorf("Error reading asset %s at %s: %v", name, path, err)
}
return buf, err
}
type asset struct {
bytes []byte
info os.FileInfo
}
// in_a_test_asset reads file data from disk. It returns an error on failure.
func in_a_test_asset() (*asset, error) {
path := "/Users/tamird/src/go/src/github.com/jteeuwen/go-bindata/testdata/in/a/test.asset"
name := "in/a/test.asset"
bytes, err := bindata_read(path, name)
if err != nil {
return nil, err
}
fi, err := os.Stat(path)
if err != nil {
err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err)
}
a := &asset{bytes: bytes, info: fi}
return a, err
}
// in_b_test_asset reads file data from disk. It returns an error on failure.
func in_b_test_asset() (*asset, error) {
path := "/Users/tamird/src/go/src/github.com/jteeuwen/go-bindata/testdata/in/b/test.asset"
name := "in/b/test.asset"
bytes, err := bindata_read(path, name)
if err != nil {
return nil, err
}
fi, err := os.Stat(path)
if err != nil {
err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err)
}
a := &asset{bytes: bytes, info: fi}
return a, err
}
// in_c_test_asset reads file data from disk. It returns an error on failure.
func in_c_test_asset() (*asset, error) {
path := "/Users/tamird/src/go/src/github.com/jteeuwen/go-bindata/testdata/in/c/test.asset"
name := "in/c/test.asset"
bytes, err := bindata_read(path, name)
if err != nil {
return nil, err
}
fi, err := os.Stat(path)
if err != nil {
err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err)
}
a := &asset{bytes: bytes, info: fi}
return a, err
}
// in_test_asset reads file data from disk. It returns an error on failure.
func in_test_asset() (*asset, error) {
path := "/Users/tamird/src/go/src/github.com/jteeuwen/go-bindata/testdata/in/test.asset"
name := "in/test.asset"
bytes, err := bindata_read(path, name)
if err != nil {
return nil, err
}
fi, err := os.Stat(path)
if err != nil {
err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err)
}
a := &asset{bytes: bytes, info: fi}
return a, err
}
// 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 {
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)
}
// 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
}
// 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 {
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)
}
// AssetNames returns the names of the assets.
func AssetNames() []string {
names := make([]string, 0, len(_bindata))
for name := range _bindata {
names = append(names, name)
}
return names
}
// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
"in/a/test.asset": in_a_test_asset,
"in/b/test.asset": in_b_test_asset,
"in/c/test.asset": in_c_test_asset,
"in/test.asset": in_test_asset,
}
// 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
// following hierarchy:
// data/
// foo.txt
// 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
// 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, "/")
for _, p := range pathList {
node = node.Children[p]
if node == nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
}
}
if node.Func != nil {
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)
}
return rv, nil
}
type _bintree_t struct {
Func func() (*asset, error)
Children map[string]*_bintree_t
}
var _bintree = &_bintree_t{nil, map[string]*_bintree_t{
"in": &_bintree_t{nil, map[string]*_bintree_t{
"a": &_bintree_t{nil, map[string]*_bintree_t{
"test.asset": &_bintree_t{in_a_test_asset, map[string]*_bintree_t{
}},
}},
"b": &_bintree_t{nil, map[string]*_bintree_t{
"test.asset": &_bintree_t{in_b_test_asset, map[string]*_bintree_t{
}},
}},
"c": &_bintree_t{nil, map[string]*_bintree_t{
"test.asset": &_bintree_t{in_c_test_asset, map[string]*_bintree_t{
}},
}},
"test.asset": &_bintree_t{in_test_asset, map[string]*_bintree_t{
}},
}},
}}
// Restore 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, path.Dir(name)), os.FileMode(0755))
if err != nil {
return err
}
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
if err != nil {
return err
}
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
if err != nil {
return err
}
return nil
}
// Restore assets under the given directory recursively
func RestoreAssets(dir, name string) error {
children, err := AssetDir(name)
if err != nil { // File
return RestoreAsset(dir, name)
} else { // Dir
for _, child := range children {
err = RestoreAssets(dir, path.Join(name, child))
if err != nil {
return err
}
}
}
return nil
}
func _filePath(dir, name string) string {
cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}

280
vendor/github.com/go-bindata/go-bindata/testdata/out/nocompress-memcopy.go generated vendored

@ -0,0 +1,280 @@
// Code generated for package main by go-bindata DO NOT EDIT.
// sources:
// in/a/test.asset
// in/b/test.asset
// in/c/test.asset
// in/test.asset
package main
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"
)
type asset struct {
bytes []byte
info os.FileInfo
}
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 _inATestAsset = []byte(`// sample file
`)
func inATestAssetBytes() ([]byte, error) {
return _inATestAsset, nil
}
func inATestAsset() (*asset, error) {
bytes, err := inATestAssetBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "in/a/test.asset", size: 15, mode: os.FileMode(436), modTime: time.Unix(1445582844, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _inBTestAsset = []byte(`// sample file
`)
func inBTestAssetBytes() ([]byte, error) {
return _inBTestAsset, nil
}
func inBTestAsset() (*asset, error) {
bytes, err := inBTestAssetBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "in/b/test.asset", size: 15, mode: os.FileMode(436), modTime: time.Unix(1445582844, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _inCTestAsset = []byte(`// sample file
`)
func inCTestAssetBytes() ([]byte, error) {
return _inCTestAsset, nil
}
func inCTestAsset() (*asset, error) {
bytes, err := inCTestAssetBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "in/c/test.asset", size: 15, mode: os.FileMode(436), modTime: time.Unix(1445582844, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _inTestAsset = []byte(`// sample file
`)
func inTestAssetBytes() ([]byte, error) {
return _inTestAsset, nil
}
func inTestAsset() (*asset, error) {
bytes, err := inTestAssetBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "in/test.asset", size: 15, mode: os.FileMode(436), modTime: time.Unix(1445582844, 0)}
a := &asset{bytes: bytes, info: info}
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 {
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)
}
// 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
}
// 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 {
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)
}
// AssetNames returns the names of the assets.
func AssetNames() []string {
names := make([]string, 0, len(_bindata))
for name := range _bindata {
names = append(names, name)
}
return names
}
// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
"in/a/test.asset": inATestAsset,
"in/b/test.asset": inBTestAsset,
"in/c/test.asset": inCTestAsset,
"in/test.asset": inTestAsset,
}
// 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
// following hierarchy:
// data/
// foo.txt
// 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
// 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, "/")
for _, p := range pathList {
node = node.Children[p]
if node == nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
}
}
if node.Func != nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
rv := make([]string, 0, len(node.Children))
for childName := range node.Children {
rv = append(rv, childName)
}
return rv, nil
}
type bintree struct {
Func func() (*asset, error)
Children map[string]*bintree
}
var _bintree = &bintree{nil, map[string]*bintree{
"in": &bintree{nil, map[string]*bintree{
"a": &bintree{nil, map[string]*bintree{
"test.asset": &bintree{inATestAsset, map[string]*bintree{}},
}},
"b": &bintree{nil, map[string]*bintree{
"test.asset": &bintree{inBTestAsset, map[string]*bintree{}},
}},
"c": &bintree{nil, map[string]*bintree{
"test.asset": &bintree{inCTestAsset, map[string]*bintree{}},
}},
"test.asset": &bintree{inTestAsset, 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
}
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
if err != nil {
return err
}
return nil
}
// 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 {
cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}

301
vendor/github.com/go-bindata/go-bindata/testdata/out/nocompress-nomemcopy.go generated vendored

@ -0,0 +1,301 @@
// Code generated by go-bindata DO NOT EDIT.
// sources:
// in/a/test.asset
// in/b/test.asset
// in/c/test.asset
// in/test.asset
package main
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"reflect"
"strings"
"time"
"unsafe"
)
func bindataRead(data, name string) ([]byte, error) {
var empty [0]byte
sx := (*reflect.StringHeader)(unsafe.Pointer(&data))
b := empty[:]
bx := (*reflect.SliceHeader)(unsafe.Pointer(&b))
bx.Data = sx.Data
bx.Len = len(data)
bx.Cap = bx.Len
return b, nil
}
type asset struct {
bytes []byte
info os.FileInfo
}
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 _inATestAsset = "\x2f\x2f\x20\x73\x61\x6d\x70\x6c\x65\x20\x66\x69\x6c\x65\x0a"
func inATestAssetBytes() ([]byte, error) {
return bindataRead(
_inATestAsset,
"in/a/test.asset",
)
}
func inATestAsset() (*asset, error) {
bytes, err := inATestAssetBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "in/a/test.asset", size: 15, mode: os.FileMode(436), modTime: time.Unix(1445582844, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _inBTestAsset = "\x2f\x2f\x20\x73\x61\x6d\x70\x6c\x65\x20\x66\x69\x6c\x65\x0a"
func inBTestAssetBytes() ([]byte, error) {
return bindataRead(
_inBTestAsset,
"in/b/test.asset",
)
}
func inBTestAsset() (*asset, error) {
bytes, err := inBTestAssetBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "in/b/test.asset", size: 15, mode: os.FileMode(436), modTime: time.Unix(1445582844, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _inCTestAsset = "\x2f\x2f\x20\x73\x61\x6d\x70\x6c\x65\x20\x66\x69\x6c\x65\x0a"
func inCTestAssetBytes() ([]byte, error) {
return bindataRead(
_inCTestAsset,
"in/c/test.asset",
)
}
func inCTestAsset() (*asset, error) {
bytes, err := inCTestAssetBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "in/c/test.asset", size: 15, mode: os.FileMode(436), modTime: time.Unix(1445582844, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _inTestAsset = "\x2f\x2f\x20\x73\x61\x6d\x70\x6c\x65\x20\x66\x69\x6c\x65\x0a"
func inTestAssetBytes() ([]byte, error) {
return bindataRead(
_inTestAsset,
"in/test.asset",
)
}
func inTestAsset() (*asset, error) {
bytes, err := inTestAssetBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "in/test.asset", size: 15, mode: os.FileMode(436), modTime: time.Unix(1445582844, 0)}
a := &asset{bytes: bytes, info: info}
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 {
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)
}
// 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
}
// 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 {
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)
}
// AssetNames returns the names of the assets.
func AssetNames() []string {
names := make([]string, 0, len(_bindata))
for name := range _bindata {
names = append(names, name)
}
return names
}
// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
"in/a/test.asset": inATestAsset,
"in/b/test.asset": inBTestAsset,
"in/c/test.asset": inCTestAsset,
"in/test.asset": inTestAsset,
}
// 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
// following hierarchy:
// data/
// foo.txt
// 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
// 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, "/")
for _, p := range pathList {
node = node.Children[p]
if node == nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
}
}
if node.Func != nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
rv := make([]string, 0, len(node.Children))
for childName := range node.Children {
rv = append(rv, childName)
}
return rv, nil
}
type bintree struct {
Func func() (*asset, error)
Children map[string]*bintree
}
var _bintree = &bintree{nil, map[string]*bintree{
"in": &bintree{nil, map[string]*bintree{
"a": &bintree{nil, map[string]*bintree{
"test.asset": &bintree{inATestAsset, map[string]*bintree{}},
}},
"b": &bintree{nil, map[string]*bintree{
"test.asset": &bintree{inBTestAsset, map[string]*bintree{}},
}},
"c": &bintree{nil, map[string]*bintree{
"test.asset": &bintree{inCTestAsset, map[string]*bintree{}},
}},
"test.asset": &bintree{inTestAsset, 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
}
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
if err != nil {
return err
}
return nil
}
// 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 {
cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}

1
vendor/github.com/go-bindata/go-bindata/testdata/symlinkFile/file1 generated vendored

@ -0,0 +1 @@
../symlinkSrc/file1

1
vendor/github.com/go-bindata/go-bindata/testdata/symlinkParent/symlinkTarget generated vendored

@ -0,0 +1 @@
../symlinkSrc/

1
vendor/github.com/go-bindata/go-bindata/testdata/symlinkRecursiveParent/file1 generated vendored

@ -0,0 +1 @@
// test file 1

1
vendor/github.com/go-bindata/go-bindata/testdata/symlinkRecursiveParent/symlinkTarget generated vendored

@ -0,0 +1 @@
../symlinkRecursiveParent/

1
vendor/github.com/go-bindata/go-bindata/testdata/symlinkSrc/file1 generated vendored

@ -0,0 +1 @@
// symlink file 1

1
vendor/github.com/go-bindata/go-bindata/testdata/symlinkSrc/file2 generated vendored

@ -0,0 +1 @@
// symlink file 2

1
vendor/github.com/go-bindata/go-bindata/testdata/symlinkSrc/file3 generated vendored

@ -0,0 +1 @@
// symlink file 3

1
vendor/github.com/go-bindata/go-bindata/testdata/symlinkSrc/file4 generated vendored

@ -0,0 +1 @@
// symlink file 4

70
vendor/github.com/jteeuwen/go-bindata/toc.go → vendor/github.com/go-bindata/go-bindata/toc.go generated vendored

@ -52,6 +52,40 @@ func (root *assetTree) funcOrNil() string {
} }
} }
func getFillerSize(tokenIndex int, lengths []int, nident int) int {
var (
curlen int = lengths[tokenIndex]
maxlen int = 0
substart int = 0
subend int = 0
spacediff int = 0
)
if curlen > 0 {
substart = tokenIndex
for (substart-1) >= 0 && lengths[substart-1] > 0 {
substart -= 1
}
subend = tokenIndex
for (subend+1) < len(lengths) && lengths[subend+1] > 0 {
subend += 1
}
var candidate int
for j := substart; j <= subend; j += 1 {
candidate = lengths[j]
if candidate > maxlen {
maxlen = candidate
}
}
spacediff = maxlen - curlen
}
return spacediff
}
func (root *assetTree) writeGoMap(w io.Writer, nident int) { func (root *assetTree) writeGoMap(w io.Writer, nident int) {
fmt.Fprintf(w, "&bintree{%s, map[string]*bintree{", root.funcOrNil()) fmt.Fprintf(w, "&bintree{%s, map[string]*bintree{", root.funcOrNil())
@ -60,16 +94,28 @@ func (root *assetTree) writeGoMap(w io.Writer, nident int) {
// Sort to make output stable between invocations // Sort to make output stable between invocations
filenames := make([]string, len(root.Children)) filenames := make([]string, len(root.Children))
hasChildren := make(map[string]bool)
i := 0 i := 0
for filename, _ := range root.Children { for filename, node := range root.Children {
filenames[i] = filename filenames[i] = filename
hasChildren[filename] = len(node.Children) > 0
i++ i++
} }
sort.Strings(filenames) sort.Strings(filenames)
for _, p := range filenames { lengths := make([]int, len(root.Children))
for i, filename := range filenames {
if hasChildren[filename] {
lengths[i] = 0
} else {
lengths[i] = len(filename)
}
}
for i, p := range filenames {
ident(w, nident+1) ident(w, nident+1)
fmt.Fprintf(w, `"%s": `, p) filler := strings.Repeat(" ", getFillerSize(i, lengths, nident))
fmt.Fprintf(w, `"%s": %s`, p, filler)
root.Children[p].writeGoMap(w, nident+1) root.Children[p].writeGoMap(w, nident+1)
} }
ident(w, nident) ident(w, nident)
@ -87,6 +133,7 @@ func (root *assetTree) WriteAsGoMap(w io.Writer) error {
Func func() (*asset, error) Func func() (*asset, error)
Children map[string]*bintree Children map[string]*bintree
} }
var _bintree = `) var _bintree = `)
root.writeGoMap(w, 0) root.writeGoMap(w, 0)
return err return err
@ -147,8 +194,16 @@ func writeTOC(w io.Writer, toc []Asset) error {
return err return err
} }
var maxlen = 0
for i := range toc { for i := range toc {
err = writeTOCAsset(w, &toc[i]) l := len(toc[i].Name)
if l > maxlen {
maxlen = l
}
}
for i := range toc {
err = writeTOCAsset(w, &toc[i], maxlen)
if err != nil { if err != nil {
return err return err
} }
@ -216,8 +271,11 @@ var _bindata = map[string]func() (*asset, error){
} }
// writeTOCAsset write a TOC entry for the given asset. // writeTOCAsset write a TOC entry for the given asset.
func writeTOCAsset(w io.Writer, asset *Asset) error { func writeTOCAsset(w io.Writer, asset *Asset, maxlen int) error {
_, err := fmt.Fprintf(w, "\t%q: %s,\n", asset.Name, asset.Func) spacediff := maxlen - len(asset.Name)
filler := strings.Repeat(" ", spacediff)
_, err := fmt.Fprintf(w, "\t%q: %s%s,\n", asset.Name, filler, asset.Func)
return err return err
} }
Loading…
Cancel
Save