Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.2% on proxy.golang.org

proxy.golang.org : github.com/zafnz/go-httptrack

The httptrack library is for http api servers that need to pass some tracking value(s) with all the http call it itself makes on behalf of the inbound request -- think microservices environment where an inbound call from a browser can result in multiple internal calls. For example; if all incoming requests have a http header called "x-tracking-id", and the service needs to make other calls to satisfy the request (eg a microservices environment) and each of the calls should also include that tracking id, then this library makes it a bit simplier and easier to not forget to pass it. Usage: Install the httptrack.Handler as middleware, specifying what values to pass through: Then later in your code, as a response to an inbound request, because you've been passing ctx to all of your functions, you need to make a http GET, instead of calling `http.NewRequestWithContext` you call `httptrack.NewRequestWithContext` as a drop in replacement: You can also just use all of the normal net/http functions, and use `httptrack.AddContextData(req http.Request)` to set the values for you.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/zafnz/go-httptrack
Keywords: api, go, http, microservices, session, tracking
License: MIT
Latest release: about 2 years ago
First release: about 2 years ago
Namespace: github.com/zafnz
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 17 days ago

    Loading...
    Readme
    Loading...