mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-03 09:51:39 +00:00
25 lines
717 B
Go
25 lines
717 B
Go
package embed
|
|||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/ipfs/boxo/files"
|
||
|
|
)
|
||
|
|
|
||
|
|
const (
|
||
|
|
AppManifestFileName = "app.webmanifest"
|
||
|
|
DWNConfigFileName = "dwn.json"
|
||
|
|
IndexHTMLFileName = "index.html"
|
||
|
|
MainJSFileName = "main.js"
|
||
|
|
ServiceWorkerFileName = "sw.js"
|
||
|
|
)
|
||
|
|
|
||
|
|
// spawnVaultDirectory creates a new directory with the default files
|
||
|
|
func NewFS(cfgBz []byte, manifestBz []byte) files.Directory {
|
||
|
|
return files.NewMapDirectory(map[string]files.Node{
|
||
|
|
AppManifestFileName: files.NewBytesFile(manifestBz),
|
||
|
|
DWNConfigFileName: files.NewBytesFile(cfgBz),
|
||
|
|
IndexHTMLFileName: files.NewBytesFile(IndexHTML),
|
||
|
|
MainJSFileName: files.NewBytesFile(MainJS),
|
||
|
|
ServiceWorkerFileName: files.NewBytesFile(WorkerJS),
|
||
|
|
})
|
||
|
|
}
|