Before you continue, ensure you meet the following requirements:
- Docker
- Go 1.17
- PostgreSQL 12
make init-db
Default server always start in port: 10080
. Please change configure in /config/default.go
if you want to start with new port
go run cmd/main.go server
http://localhost:10080/swagger-ui
go run cmd/main.go scanner
The following instructions assume you are using Buf Docs Installation
brew tap bufbuild/buf
brew install buf
The following instructions assume you are using Go Modules for dependency management. Use a tool dependency to track the versions of the following executable packages:
// +build tools
package tools
import (
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway"
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2"
_ "google.golang.org/grpc/cmd/protoc-gen-go-grpc"
_ "google.golang.org/protobuf/cmd/protoc-gen-go"
)
Run go mod tidy
to resolve the versions.
Install by running
go install \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \
google.golang.org/protobuf/cmd/protoc-gen-go \
google.golang.org/grpc/cmd/protoc-gen-go-grpc
This will place four binaries in your $GOBIN
;
protoc-gen-grpc-gateway
protoc-gen-openapiv2
protoc-gen-go
protoc-gen-go-grpc
Make sure that your $GOBIN
is in your $PATH
.
Alternatively, see the section on remotely managed plugin versions below.
buf generate