mirror of
https://github.com/cf-sonr/motr.git
synced 2026-01-12 11:09:13 +00:00
33 lines
475 B
Go
33 lines
475 B
Go
//go:build js && wasm
|
|
// +build js,wasm
|
|
|
|
package kvstore
|
|
|
|
var (
|
|
sessionsKV Store
|
|
handlesKV Store
|
|
)
|
|
|
|
const (
|
|
kHandlesBinding = "HANDLES_KV"
|
|
kSessionsBinding = "SESSIONS_KV"
|
|
)
|
|
|
|
func IsReady() bool {
|
|
return sessionsKV != nil && handlesKV != nil
|
|
}
|
|
|
|
func Sessions() Store {
|
|
if sessionsKV == nil {
|
|
panic("sessionsKV is not initialized")
|
|
}
|
|
return sessionsKV
|
|
}
|
|
|
|
func Handles() Store {
|
|
if handlesKV == nil {
|
|
panic("handlesKV is not initialized")
|
|
}
|
|
return handlesKV
|
|
}
|