make the wasm-go lib easier to use (#58)

This commit is contained in:
澄潭
2022-11-16 11:43:46 +08:00
committed by GitHub
parent bb09426753
commit 4eb91e6918
5 changed files with 71 additions and 32 deletions

View File

@@ -31,7 +31,7 @@ func main() {
type HelloWorldConfig struct {
}
func onHttpRequestHeaders(ctx *wrapper.CommonHttpCtx[HelloWorldConfig], config HelloWorldConfig, needBody *bool, log wrapper.LogWrapper) types.Action {
func onHttpRequestHeaders(ctx wrapper.HttpContext, config HelloWorldConfig, log wrapper.Log) types.Action {
err := proxywasm.AddHttpRequestHeader("hello", "world")
if err != nil {
log.Critical("failed to set request header")