Add Asset Embedding
This commit is contained in:
parent
d7213e03da
commit
f54644e3e9
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