Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit 5adf29a

Browse files
committed
feat: add GetRootContextByID call
1 parent 72ffe0f commit 5adf29a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

proxywasm/hostcall.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ func GetCurrentTime() int64 {
5050
return t
5151
}
5252

53+
func GetRootContextByID(rootContextID uint32) (RootContext, error) {
54+
rootContextState, ok := currentState.rootContexts[rootContextID]
55+
if !ok {
56+
return nil, types.ErrorStatusNotFound
57+
}
58+
return rootContextState.context, nil
59+
}
60+
5361
func DispatchHttpCall(upstream string,
5462
headers [][2]string, body string, trailers [][2]string,
5563
timeoutMillisecond uint32, callBack HttpCalloutCallBack) (calloutID uint32, err error) {

0 commit comments

Comments
 (0)