Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
github.com/fogfish/gouldian/v2
Go combinator library for building containerized and serverless HTTP services.
The library is a thin layer of purely functional abstractions to build HTTP services. In the contrast with other HTTP routers, the library resolves a challenge of building simple and declarative api implementations in the absence of pattern matching at Golang. The library also support opaque migration of HTTP service between traditional, containers and serverless environments.
User Guide | Hello World | Other Examples | Benchmark
Microservices have become a design style to evolve system architecture in parallel, implement stable and consistent interfaces within distributed system. An expressive language is required to design the manifold of network interfaces. A pure functional languages fits very well to express communication behavior due they rich techniques to hide the networking complexity. Finch is the best library in Scala for microservice development. Gouldian is heavily inspired by Finch.
The library solves few practical problems of HTTP service development in Golang:
http.Request
APIGatewayProxyRequest
.The library requires Go 1.18 or later.
The latest version of the library is available at main
branch. All development, including new features and bug fixes, take place on the main
branch using forking and pull requests as described in contribution guidelines. The stable version is available via Golang modules.
go get
to retrieve the library and add it as dependency to your application.go get -u github.com/fogfish/gouldian
import (
µ "github.com/fogfish/gouldian"
)
Here is minimal "Hello World!" example that matches any HTTP requests
to /hello
endpoint. You can run this example locally see the instructions.
package main
import (
µ "github.com/fogfish/gouldian"
"github.com/fogfish/gouldian/server/httpd"
"net/http"
)
func main() {
http.ListenAndServe(":8080",
httpd.Serve(hello()),
)
}
func hello() µ.Routable {
return µ.GET(
µ.URI(µ.Path("hello")),
func(ctx µ.Context) error {
return µ.Status.OK(µ.WithText("Hello World!"))
},
)
}
The library uses go-http-routing-benchmark methodology for benchmarking, using structure of GitHub API as primary benchmark. The results are obtained on the reference hardware such as AWS m6i.large and a1.large instances.
m6i.large 3.5 GHz 3rd generation Intel Xeon Scalable processors:
a1.large AWS Graviton Processor with 64-bit Arm Neoverse cores:
Study User Guide.
Check build-in collection of endpoints to deal with HTTP request: path, query param, http header, body and other
Endpoint always returns some Output
that defines HTTP response. There are three cases of output: HTTP Success, HTTP Failure and general error. See Output type.
See example folder for other advanced use-case.
Learn about microservice deployment with AWS CDK, in case of serverless development
The library is Apache 2.0 licensed and accepts contributions via GitHub pull requests:
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)The build and testing process requires Go version 1.13 or later.
Build and run in your development console.
git clone https://github.com/fogfish/gouldian
cd gouldian
go test
go test -run=^$ -bench=. -cpu 1
The commit message helps us to write a good release note, speed-up review process. The message should address two question what changed and why. The project follows the template defined by chapter Contributing to a Project of Git book.
If you experience any issues with the library, please let us know via GitHub issues. We appreciate detailed and accurate reports that help us to identity and replicate the issue.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.