
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
github.com/micro/go-web
Supply Chain Security
Vulnerability
Quality
Maintenance
License
Go Web is a framework for micro service web development.
Go Web provides a tiny HTTP web server library which leverages go-micro to create micro web services as first class citizens in a microservice world. It wraps go-micro to give you service discovery, heartbeating and the ability to create web apps as microservices.
Service Discovery - Services are automatically registered in service discovery on startup. Go Web includes a http.Client with pre-initialised roundtripper which makes use of service discovery so you can use service names.
Heartbeating - Go Web apps will periodically heartbeat with service discovery to provide liveness updates. In the event a service fails it will be removed from the registry after a pre-defined expiry time.
Custom Handlers - Specify your own http router for handling requests. This allows you to maintain full control over how you want to route to internal handlers.
Go Web makes use of Go Micro which means it needs service discovery
See the go-micro for install instructions
For a quick start use consul
# install
brew install consul
# run
consul agent -dev
service := web.NewService(
web.Name("example.com"),
)
service.HandleFunc("/foo", fooHandler)
if err := service.Init(); err != nil {
log.Fatal(err)
}
if err := service.Run(); err != nil {
log.Fatal(err)
}
You might have a preference for a HTTP handler, so use something else. This loses the ability to register endpoints in discovery but we'll fix that soon.
import "github.com/gorilla/mux"
r := mux.NewRouter()
r.HandleFunc("/", indexHandler)
r.HandleFunc("/objects/{object}", objectHandler)
service := web.NewService(
web.Handler(r)
)
Go-web includes a http.Client with a custom http.RoundTripper that uses service discovery
c := service.Client()
rsp, err := c.Get("http://example.com/foo")
This will lookup service discovery for the service example.com
and route to one of the available nodes.
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
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.