mirror of https://github.com/OrbTools/OrbMap
Updates, cleaning, and now evc maps are held in a map
parent
9184cc640d
commit
d5225ef0dd
@ -0,0 +1,42 @@
|
||||
package box
|
||||
|
||||
type embedBox struct {
|
||||
storage map[string][]byte
|
||||
}
|
||||
|
||||
// Create new box for embed files
|
||||
func newEmbedBox() *embedBox {
|
||||
return &embedBox{storage: make(map[string][]byte)}
|
||||
}
|
||||
|
||||
// Add a file to box
|
||||
func (e *embedBox) Add(file string, content []byte) {
|
||||
e.storage[file] = content
|
||||
}
|
||||
|
||||
// Get file's content
|
||||
func (e *embedBox) Get(file string) []byte {
|
||||
if f, ok := e.storage[file]; ok {
|
||||
return f
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Embed box expose
|
||||
var box = newEmbedBox()
|
||||
|
||||
// Add a file content to box
|
||||
func Add(file string, content []byte) {
|
||||
box.Add(file, content)
|
||||
}
|
||||
|
||||
// Get a file from box
|
||||
func Get(file string) []byte {
|
||||
return box.Get(file)
|
||||
}
|
||||
|
||||
// Code generated by go generate; DO NOT EDIT.
|
||||
|
||||
func init() {
|
||||
box.Add("orbweaver.dev", []byte{41, 2, 3, 4, 5, 15, 16, 17, 18, 19, 58, 30, 31, 32, 33, 42, 44, 45, 46, 47, 56, 103, 106, 108, 105, 57})
|
||||
}
|
Loading…
Reference in New Issue