summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/GeertJohan/go.rice/embedded/embedded.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-08-06 21:47:05 +0200
committerWim <wim@42.be>2018-08-06 21:47:05 +0200
commit51062863a5c34d81e296cf15c61140911037cf3b (patch)
tree9b5e044672486326c7a0ca8fb26430f37bf4d83c /vendor/github.com/GeertJohan/go.rice/embedded/embedded.go
parent4fb4b7aa6c02a54db8ad8dd98e4d321396926c0d (diff)
downloadmatterbridge-msglm-51062863a5c34d81e296cf15c61140911037cf3b.tar.gz
matterbridge-msglm-51062863a5c34d81e296cf15c61140911037cf3b.tar.bz2
matterbridge-msglm-51062863a5c34d81e296cf15c61140911037cf3b.zip
Use mod vendor for vendored directory (backwards compatible)
Diffstat (limited to 'vendor/github.com/GeertJohan/go.rice/embedded/embedded.go')
-rw-r--r--vendor/github.com/GeertJohan/go.rice/embedded/embedded.go80
1 files changed, 0 insertions, 80 deletions
diff --git a/vendor/github.com/GeertJohan/go.rice/embedded/embedded.go b/vendor/github.com/GeertJohan/go.rice/embedded/embedded.go
deleted file mode 100644
index bba8e588..00000000
--- a/vendor/github.com/GeertJohan/go.rice/embedded/embedded.go
+++ /dev/null
@@ -1,80 +0,0 @@
-// Package embedded defines embedded data types that are shared between the go.rice package and generated code.
-package embedded
-
-import (
- "fmt"
- "path/filepath"
- "strings"
- "time"
-)
-
-const (
- EmbedTypeGo = 0
- EmbedTypeSyso = 1
-)
-
-// EmbeddedBox defines an embedded box
-type EmbeddedBox struct {
- Name string // box name
- Time time.Time // embed time
- EmbedType int // kind of embedding
- Files map[string]*EmbeddedFile // ALL embedded files by full path
- Dirs map[string]*EmbeddedDir // ALL embedded dirs by full path
-}
-
-// Link creates the ChildDirs and ChildFiles links in all EmbeddedDir's
-func (e *EmbeddedBox) Link() {
- for path, ed := range e.Dirs {
- fmt.Println(path)
- ed.ChildDirs = make([]*EmbeddedDir, 0)
- ed.ChildFiles = make([]*EmbeddedFile, 0)
- }
- for path, ed := range e.Dirs {
- parentDirpath, _ := filepath.Split(path)
- if strings.HasSuffix(parentDirpath, "/") {
- parentDirpath = parentDirpath[:len(parentDirpath)-1]
- }
- parentDir := e.Dirs[parentDirpath]
- if parentDir == nil {
- panic("parentDir `" + parentDirpath + "` is missing in embedded box")
- }
- parentDir.ChildDirs = append(parentDir.ChildDirs, ed)
- }
- for path, ef := range e.Files {
- dirpath, _ := filepath.Split(path)
- if strings.HasSuffix(dirpath, "/") {
- dirpath = dirpath[:len(dirpath)-1]
- }
- dir := e.Dirs[dirpath]
- if dir == nil {
- panic("dir `" + dirpath + "` is missing in embedded box")
- }
- dir.ChildFiles = append(dir.ChildFiles, ef)
- }
-}
-
-// EmbeddedDir is instanced in the code generated by the rice tool and contains all necicary information about an embedded file
-type EmbeddedDir struct {
- Filename string
- DirModTime time.Time
- ChildDirs []*EmbeddedDir // direct childs, as returned by virtualDir.Readdir()
- ChildFiles []*EmbeddedFile // direct childs, as returned by virtualDir.Readdir()
-}
-
-// EmbeddedFile is instanced in the code generated by the rice tool and contains all necicary information about an embedded file
-type EmbeddedFile struct {
- Filename string // filename
- FileModTime time.Time
- Content string
-}
-
-// EmbeddedBoxes is a public register of embedded boxes
-var EmbeddedBoxes = make(map[string]*EmbeddedBox)
-
-// RegisterEmbeddedBox registers an EmbeddedBox
-func RegisterEmbeddedBox(name string, box *EmbeddedBox) {
- if _, exists := EmbeddedBoxes[name]; exists {
- panic(fmt.Sprintf("EmbeddedBox with name `%s` exists already", name))
- }
- EmbeddedBoxes[name] = box
-}