mirror of
https://github.com/syumai/workers.git
synced 2025-03-10 17:29:11 +00:00
Fix reference to getRuntimeContextEnv
This commit is contained in:
parent
0931e915c4
commit
28533fa0da
@ -6,6 +6,7 @@ import (
|
||||
"net/http"
|
||||
"syscall/js"
|
||||
|
||||
"github.com/syumai/workers/cloudflare/internal/cfruntimecontext"
|
||||
"github.com/syumai/workers/internal/jshttp"
|
||||
"github.com/syumai/workers/internal/jsutil"
|
||||
)
|
||||
@ -20,7 +21,7 @@ type DurableObjectNamespace struct {
|
||||
// This binding must be defined in the `wrangler.toml` file. The method will
|
||||
// return an `error` when there is no binding defined by `varName`.
|
||||
func NewDurableObjectNamespace(ctx context.Context, varName string) (*DurableObjectNamespace, error) {
|
||||
inst := getRuntimeContextEnv(ctx).Get(varName)
|
||||
inst := cfruntimecontext.GetRuntimeContextEnv(ctx).Get(varName)
|
||||
if inst.IsUndefined() {
|
||||
return nil, fmt.Errorf("%s is undefined", varName)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user