# GoWrap

A command-line tool that generates decorators for Go interfaces from templates, adding metrics, tracing, retries, rate limiting and fallbacks to existing code.

GoWrap generates decorators for Go interface types from templates, letting a developer add cross-cutting behavior such as metrics, tracing, fallbacks, pools and rate limiting to existing code without writing the wrapper by hand. It can use a local template file or fall back to a set of hosted templates identified by name.

Among the hosted templates are a circuit breaker that stops calling a wrapped interface after repeated errors, a fallback decorator that runs several implementations concurrently and returns the first successful result, logging decorators for the standard library logger and for logrus, tracing decorators for OpenCensus, OpenTelemetry and OpenTracing, a Prometheus metrics decorator, rate limiting and retry decorators, and pooling decorators that distribute calls round robin or through a sync.Pool.

It installs as a Go module and is released under the MIT license.

Website: https://github.com/hexdigest/gowrap
