![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/devpablocristo/conceptos-go/go-hexagonal-shortener
This application implements a Golang backend using Hexagonal Architecture which aims to decouple the components of the domain/application from the frameworks like http server, storage and others.
To demonstrate this, this application implements a simple URL Shortener which makes use of different adapters. The application can be executed from command-line, or as a service (HTTP and gRPC).
The application needs an instance of Redis or MongoDB running. Just check the cmd/cli/main.go or cmd/http/main.go and adjust the connection string for your servers.
$ go run cmd/cli/main.go
You would get an output like the following:
Generating Code from URL: http://www.google.com
{"code":"LWK9v1Qng","url":"http://www.google.com","created_at":1650829428}
Retrieve the URL from code: LWK9v1Qng
{"code":"LWK9v1Qng","url":"http://www.google.com","created_at":1650829428}
$ go run cmd/http/main.go
You would get an output like the following:
CHI listening on :8000
GIN listening on :9000
GRPC listening on :7000
From now, you can perform HTTP requests on http://localhost:8000 and http://localhost:9000
Method GET
Endpoint: <hostname:port>/:code
Code is the short code generated from a given URL.
Method POST
Endpoint: <hostname:port>/
Payload:
{
"url": "http://www.google.com"
}
Example using curl:
curl --request POST 'localhost:9000/' \
--header 'Content-Type: application/json' \
--data '{"url": "http://www.google.com.br"}'
Expected output
{"code":"AS4YOJQ7R","url":"http://www.google.com.br","created_at":1650830243}
The code show how to use evans in interactive mode to perform gRPC call.
cd adapter/grpc/proto
evans --host localhost --port 7000 --proto shortener_msg.proto,shortener_service.proto
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.