The swagger
file (api.yml
) exists in docs
directory. You can see All APIs of Argus service in this file.
api
: API documents like Swagger file.cmd
: Service entry points (Argus service).config
: Files containing configuration structs for Argus service.internal
: all application specific logic are implemented here.db
: Database schema and queries.handlers
: All Gin handlers.iputil
: Customized wrapper for IPInfo service.routes
: Creating Gin server and Routing different requests.
pkg
: General purpose packages likelogger
,otel
.test
: Contains scripts for load testing
To update the swagger docs you can use
swag init -g ./cmd/argus/main.go -o api
# We need to exclude the vendor directory
find . -name '*.go' ! -path './vendor/*' -type f -exec go fmt {} \;
# We need to exclude the vendor directory
find . -name '*.go' ! -path './vendor/*' -type f | xargs goimports -w
You can create a pre-commit hook that automatically runs each one of linting commands before git commits. To enable the project's git hook use this command.
cp githooks/pre-commit .git/hooks/pre-commit