@@ -47,7 +47,7 @@ func newHttpHostEmulator() *httpHostEmulator {
4747 return host
4848}
4949
50- // impl host rawhostcall.ProxyWASMHost: delegated from hostEmulator
50+ // impl rawhostcall.ProxyWASMHost: delegated from hostEmulator
5151func (h * httpHostEmulator ) httpHostEmulatorProxyGetBufferBytes (bt types.BufferType , start int , maxSize int ,
5252 returnBufferData * * byte , returnBufferSize * int ) types.Status {
5353 active := proxywasm .VMStateGetActiveContextID ()
@@ -76,7 +76,7 @@ func (h *httpHostEmulator) httpHostEmulatorProxyGetBufferBytes(bt types.BufferTy
7676 return types .StatusOK
7777}
7878
79- // impl host rawhostcall.ProxyWASMHost: delegated from hostEmulator
79+ // impl rawhostcall.ProxyWASMHost: delegated from hostEmulator
8080func (h * httpHostEmulator ) httpHostEmulatorProxyGetHeaderMapValue (mapType types.MapType , keyData * byte ,
8181 keySize int , returnValueData * * byte , returnValueSize * int ) types.Status {
8282 key := proxywasm .RawBytePtrToString (keyData , keySize )
@@ -109,7 +109,7 @@ func (h *httpHostEmulator) httpHostEmulatorProxyGetHeaderMapValue(mapType types.
109109 return types .StatusNotFound
110110}
111111
112- // impl host rawhostcall.ProxyWASMHost
112+ // impl rawhostcall.ProxyWASMHost
113113func (h * httpHostEmulator ) ProxyAddHeaderMapValue (mapType types.MapType , keyData * byte ,
114114 keySize int , valueData * byte , valueSize int ) types.Status {
115115
@@ -145,7 +145,7 @@ func addMapValue(base [][2]string, key, value string) [][2]string {
145145 return append (base , [2 ]string {key , value })
146146}
147147
148- // impl host rawhostcall.ProxyWASMHost
148+ // impl rawhostcall.ProxyWASMHost
149149func (h * httpHostEmulator ) ProxyReplaceHeaderMapValue (mapType types.MapType , keyData * byte ,
150150 keySize int , valueData * byte , valueSize int ) types.Status {
151151 key := proxywasm .RawBytePtrToString (keyData , keySize )
@@ -168,7 +168,7 @@ func (h *httpHostEmulator) ProxyReplaceHeaderMapValue(mapType types.MapType, key
168168 return types .StatusOK
169169}
170170
171- // impl host rawhostcall.ProxyWASMHost
171+ // impl rawhostcall.ProxyWASMHost
172172func replaceMapValue (base [][2 ]string , key , value string ) [][2 ]string {
173173 for i , h := range base {
174174 if h [0 ] == key {
@@ -180,7 +180,7 @@ func replaceMapValue(base [][2]string, key, value string) [][2]string {
180180 return append (base , [2 ]string {key , value })
181181}
182182
183- // impl host rawhostcall.ProxyWASMHost
183+ // impl rawhostcall.ProxyWASMHost
184184func (h * httpHostEmulator ) ProxyRemoveHeaderMapValue (mapType types.MapType , keyData * byte , keySize int ) types.Status {
185185 key := proxywasm .RawBytePtrToString (keyData , keySize )
186186 active := proxywasm .VMStateGetActiveContextID ()
@@ -214,7 +214,7 @@ func removeHeaderMapValue(base [][2]string, key string) [][2]string {
214214 return base
215215}
216216
217- // impl host rawhostcall.ProxyWASMHost: delegated from hostEmulator
217+ // impl rawhostcall.ProxyWASMHost: delegated from hostEmulator
218218func (h * httpHostEmulator ) httpHostEmulatorProxyGetHeaderMapPairs (mapType types.MapType , returnValueData * * byte ,
219219 returnValueSize * int ) types.Status {
220220 active := proxywasm .VMStateGetActiveContextID ()
@@ -239,7 +239,7 @@ func (h *httpHostEmulator) httpHostEmulatorProxyGetHeaderMapPairs(mapType types.
239239 return types .StatusOK
240240}
241241
242- // impl host rawhostcall.ProxyWASMHost
242+ // impl rawhostcall.ProxyWASMHost
243243func (h * httpHostEmulator ) ProxySetHeaderMapPairs (mapType types.MapType , mapData * byte , mapSize int ) types.Status {
244244 m := proxywasm .DeserializeMap (proxywasm .RawBytePtrToByteSlice (mapData , mapSize ))
245245 active := proxywasm .VMStateGetActiveContextID ()
@@ -260,15 +260,15 @@ func (h *httpHostEmulator) ProxySetHeaderMapPairs(mapType types.MapType, mapData
260260 return types .StatusOK
261261}
262262
263- // impl host rawhostcall.ProxyWASMHost
263+ // impl rawhostcall.ProxyWASMHost
264264func (h * httpHostEmulator ) ProxyContinueStream (types.StreamType ) types.Status {
265265 active := proxywasm .VMStateGetActiveContextID ()
266266 stream := h .httpStreams [active ]
267267 stream .action = types .ActionContinue
268268 return types .StatusOK
269269}
270270
271- // impl host rawhostcall.ProxyWASMHost
271+ // impl rawhostcall.ProxyWASMHost
272272func (h * httpHostEmulator ) ProxySendLocalResponse (statusCode uint32 ,
273273 statusCodeDetailData * byte , statusCodeDetailsSize int , bodyData * byte , bodySize int ,
274274 headersData * byte , headersSize int , grpcStatus int32 ) types.Status {
@@ -284,15 +284,15 @@ func (h *httpHostEmulator) ProxySendLocalResponse(statusCode uint32,
284284 return types .StatusOK
285285}
286286
287- // impl host HostEmulator
287+ // impl HostEmulator
288288func (h * httpHostEmulator ) HttpFilterInitContext () (contextID uint32 ) {
289289 contextID = getNextContextID ()
290290 proxywasm .ProxyOnContextCreate (contextID , rootContextID )
291291 h .httpStreams [contextID ] = & httpStreamState {action : types .ActionContinue }
292292 return
293293}
294294
295- // impl host HostEmulator
295+ // impl HostEmulator
296296func (h * httpHostEmulator ) HttpFilterPutRequestHeaders (contextID uint32 , headers [][2 ]string ) {
297297 cs , ok := h .httpStreams [contextID ]
298298 if ! ok {
@@ -304,7 +304,7 @@ func (h *httpHostEmulator) HttpFilterPutRequestHeaders(contextID uint32, headers
304304 len (headers ), false ) // TODO: allow for specifying end_of_stream
305305}
306306
307- // impl host HostEmulator
307+ // impl HostEmulator
308308func (h * httpHostEmulator ) HttpFilterPutResponseHeaders (contextID uint32 , headers [][2 ]string ) {
309309 cs , ok := h .httpStreams [contextID ]
310310 if ! ok {
@@ -317,7 +317,7 @@ func (h *httpHostEmulator) HttpFilterPutResponseHeaders(contextID uint32, header
317317 len (headers ), false ) // TODO: allow for specifying end_of_stream
318318}
319319
320- // impl host HostEmulator
320+ // impl HostEmulator
321321func (h * httpHostEmulator ) HttpFilterPutRequestTrailers (contextID uint32 , headers [][2 ]string ) {
322322 cs , ok := h .httpStreams [contextID ]
323323 if ! ok {
@@ -328,7 +328,7 @@ func (h *httpHostEmulator) HttpFilterPutRequestTrailers(contextID uint32, header
328328 cs .action = proxywasm .ProxyOnRequestTrailers (contextID , len (headers ))
329329}
330330
331- // impl host HostEmulator
331+ // impl HostEmulator
332332func (h * httpHostEmulator ) HttpFilterPutResponseTrailers (contextID uint32 , headers [][2 ]string ) {
333333 cs , ok := h .httpStreams [contextID ]
334334 if ! ok {
@@ -339,7 +339,7 @@ func (h *httpHostEmulator) HttpFilterPutResponseTrailers(contextID uint32, heade
339339 cs .action = proxywasm .ProxyOnResponseTrailers (contextID , len (headers ))
340340}
341341
342- // impl host HostEmulator
342+ // impl HostEmulator
343343func (h * httpHostEmulator ) HttpFilterPutRequestBody (contextID uint32 , body []byte ) {
344344 cs , ok := h .httpStreams [contextID ]
345345 if ! ok {
@@ -351,7 +351,7 @@ func (h *httpHostEmulator) HttpFilterPutRequestBody(contextID uint32, body []byt
351351 len (body ), false ) // TODO: allow for specifying end_of_stream
352352}
353353
354- // impl host HostEmulator
354+ // impl HostEmulator
355355func (h * httpHostEmulator ) HttpFilterPutResponseBody (contextID uint32 , body []byte ) {
356356 cs , ok := h .httpStreams [contextID ]
357357 if ! ok {
@@ -363,12 +363,12 @@ func (h *httpHostEmulator) HttpFilterPutResponseBody(contextID uint32, body []by
363363 len (body ), false ) // TODO: allow for specifying end_of_stream
364364}
365365
366- // impl host HostEmulator
366+ // impl HostEmulator
367367func (h * httpHostEmulator ) HttpFilterCompleteHttpStream (contextID uint32 ) {
368368 proxywasm .ProxyOnDone (contextID )
369369}
370370
371- // impl host HostEmulator
371+ // impl HostEmulator
372372func (h * httpHostEmulator ) HttpFilterGetCurrentStreamAction (contextID uint32 ) types.Action {
373373 stream , ok := h .httpStreams [contextID ]
374374 if ! ok {
@@ -377,7 +377,7 @@ func (h *httpHostEmulator) HttpFilterGetCurrentStreamAction(contextID uint32) ty
377377 return stream .action
378378}
379379
380- // impl host HostEmulator
380+ // impl HostEmulator
381381func (h * httpHostEmulator ) HttpFilterGetSentLocalResponse (contextID uint32 ) * LocalHttpResponse {
382382 return h .httpStreams [contextID ].sentLocalResponse
383383}
0 commit comments