
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
github.com/caarlos0/go-web-api-example
The idea is to provide a sample architecture for web API's written in Go, using PostgreSQL as database and Prometheus for metrics.
$ tree -d .
.
├── config
├── controller
├── datastore
│ └── database
├── migrations
└── model
config
: contains the config parsing logic;controller
: contains the controllers, which usually take an instance
of the datasource as parameter;datasource
: contains the interfaces that define the access to the database;datasource/database
: contains the real implementation of the datasource
interfaces;migrations
: simple SQL files to setup the database;model
: contains the models, which are usually shared accross several
packages.Golang needs packages to be placed in the right folders inside $GOPATH
to work properly:
$ cd $GOPATH
$ mkdir -p src/github.com/caarlos0
$ cd $_
$ git clone git@github.com:caarlos0/go-web-api-example.git
$ cd go-web-api-example
To install all dependencies, just run:
$ make setup
There are several tasks available, try make help
$ createdb beers
$ for sql in ./migrations/*; do psql ab -f $sql; done
$ go run main.go
It should be alive at port 3000!
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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.