Add Asset Embedding
This commit is contained in:
parent
d7213e03da
commit
f54644e3e9
2
main.go
2
main.go
|
@ -10,7 +10,7 @@ import (
|
|||
)
|
||||
func init() {
|
||||
aid.LoadConfig()
|
||||
|
||||
|
||||
var device storage.Storage
|
||||
switch aid.Config.Database.Type {
|
||||
case "postgres":
|
||||
|
|
1
storage/assets/data.json
Normal file
1
storage/assets/data.json
Normal file
|
@ -0,0 +1 @@
|
|||
{}
|
20
storage/embeds.go
Normal file
20
storage/embeds.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package storage
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var (
|
||||
//go:embed assets/*
|
||||
Assets embed.FS
|
||||
)
|
||||
|
||||
func Asset(file string) (*[]byte) {
|
||||
data, err := Assets.ReadFile("assets/" + strings.ToLower(file))
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return &data
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
package store
|
||||
|
||||
type Storefront interface{}
|
Loading…
Reference in New Issue
Block a user