Add Asset Embedding

This commit is contained in:
eccentric 2023-11-08 22:09:08 +00:00
parent d7213e03da
commit f54644e3e9
4 changed files with 22 additions and 4 deletions

View File

@ -10,7 +10,7 @@ import (
) )
func init() { func init() {
aid.LoadConfig() aid.LoadConfig()
var device storage.Storage var device storage.Storage
switch aid.Config.Database.Type { switch aid.Config.Database.Type {
case "postgres": case "postgres":

1
storage/assets/data.json Normal file
View File

@ -0,0 +1 @@
{}

20
storage/embeds.go Normal file
View 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
}

View File

@ -1,3 +0,0 @@
package store
type Storefront interface{}