nottinygc
proxy-wasm-go-sdk
nottinygc | proxy-wasm-go-sdk | |
---|---|---|
1 | 2 | |
60 | 660 | |
- | 0.9% | |
7.1 | 6.2 | |
2 months ago | 3 months ago | |
Go | Go | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
nottinygc
-
Boehm-Demers-Weiser Garbage Collector
And it works great with WebAssembly! I was pleasantly surprised to be able to use this mature GC to power garbage collection for Go when compiled to Wasm.
https://github.com/wasilibs/nottinygc
proxy-wasm-go-sdk
-
A "Tiny" APISIX Plugin
// references: // https://github.com/tetratelabs/proxy-wasm-go-sdk/tree/main/examples // https://github.com/apache/apisix/blob/master/t/wasm/ package main import ( "github.com/tetratelabs/proxy-wasm-go-sdk/proxywasm" "github.com/tetratelabs/proxy-wasm-go-sdk/proxywasm/types" "github.com/valyala/fastjson" ) func main() { proxywasm.SetVMContext(&vmContext{}) } // each plugin has its own VMContext. // it is responsible for creating multiple PluginContexts for each route. type vmContext struct { types.DefaultVMContext } // each route has its own PluginContext. // it corresponds to one instance of the plugin. func (*vmContext) NewPluginContext(contextID uint32) types.PluginContext { return &pluginContext{} } type header struct { Name string Value string } type pluginContext struct { types.DefaultPluginContext Headers []header } func (ctx *pluginContext) OnPluginStart(pluginConfigurationSize int) types.OnPluginStartStatus { data, err := proxywasm.GetPluginConfiguration() if err != nil { proxywasm.LogErrorf("error reading plugin configuration: %v", err) return types.OnPluginStartStatusFailed } var p fastjson.Parser v, err := p.ParseBytes(data) if err != nil { proxywasm.LogErrorf("error decoding plugin configuration: %v", err) return types.OnPluginStartStatusFailed } headers := v.GetArray("headers") ctx.Headers = make([]header, len(headers)) for i, hdr := range headers { ctx.Headers[i] = header{ Name: string(hdr.GetStringBytes("name")), Value: string(hdr.GetStringBytes("value")), } } return types.OnPluginStartStatusOK } // each HTTP request to a route has its own HTTPContext func (ctx *pluginContext) NewHttpContext(contextID uint32) types.HttpContext { return &httpContext{parent: ctx} } type httpContext struct { types.DefaultHttpContext parent *pluginContext } func (ctx *httpContext) OnHttpResponseHeaders(numHeaders int, endOfStream bool) types.Action { plugin := ctx.parent for _, hdr := range plugin.Headers { proxywasm.ReplaceHttpResponseHeader(hdr.Name, hdr.Value) } return types.ActionContinue }
-
Unlocking Istio's Versatility: A Guide to WASM Plugins in Kubernetes
Go (TinyGo) SDK
What are some alternatives?
sgcl - Smart Garbage Collection Library for C++
envoy-preflight - A wrapper for applications to help with running envoy as a sidecar
aplette - This is a new take on an old language: APL. The goal is to pare APL down to its elegant essence. This version of APL is oriented toward scripting within a Unix-style computing environment.
spec - WebAssembly for Proxies (ABI specification)
capsule - A Capsule application is a runner (or launcher) of wasm functions. Capsule HTTP can serve the functions through HTTP (it’s possible to use Capsule as a simple CLI with Capsule CLI). And soon: NATS and MQTT
proxy-wasm-zig-sdk - WebAssembly for Proxies (Zig SDK)
go-re2 - Drop-in replacement for regexp using re2, for any Go app
proxy-wasm-rust-sdk - WebAssembly for Proxies (Rust SDK)
bdwgc - The Boehm-Demers-Weiser conservative C/C++ Garbage Collector (bdwgc, also known as bdw-gc, boehm-gc, libgc)
proxy-runtime
vecty - Vecty lets you build responsive and dynamic web frontends in Go using WebAssembly, competing with modern web frameworks like React & VueJS.
proxy-wasm-cpp-sdk - WebAssembly for Proxies (C++ SDK)