![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
github.com/go-on/wrap
Package wrap creates a fast and flexible middleware stack for http.Handlers.
Import it via gopkg.in: import "gopkg.in/go-on/wrap.v2"
.
wrap.New(w ...Wrapper)
creates a stack of middlewares. Wrapper
is defined as
type Wrapper interface {
Wrap(next http.Handler) (previous http.Handler)
}
Each wrapper wraps the the http.Handler
that comes further down
the middleware stack and returns a http.Handler
that handles the
request previously.
See example_test.go
for a simple example without context and example_context_test.go
for an example with context sharing.
Also look into the repository of blessed middleware github.com/go-on/wrap-contrib/wraps.
more examples and middleware and can be found at github.com/go-on/wrap-contrib
A router that is also tested but may change, can be found at github.com/go-on/router
// The overhead of n writes to http.ResponseWriter via n wrappers
// vs n writes in a loop within a single http.Handler
BenchmarkServing2Simple 1000000 1067 ns/op 1,00x
BenchmarkServing2Wrappers 1000000 1121 ns/op 1,05x
BenchmarkServing50Simple 100000 26041 ns/op 1,00x
BenchmarkServing50Wrappers 100000 27053 ns/op 1,04x
BenchmarkServing100Simple 50000 52074 ns/op 1,00x
BenchmarkServing100Wrappers 50000 53450 ns/op 1,03x
Initial inspiration came from Christian Neukirchen's rack for ruby some years ago.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.