Backend for richmond app from https://github.com/Lokrand/richmond
go run main.gobuild binary
go build -o ./build/richmond-apigo install github.com/rakyll/gotest@latest
gotest ./... -vAUTH_USER=admin AUTH_PASS=admin docker compose -f ./deploy/compose.yaml up -d rustfs postgresInstall Dependencies
go mod download
go install github.com/swaggo/swag/v2/cmd/swag@latest
go install github.com/air-verse/air@latest
go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
go install github.com/pressly/goose/v3/cmd/goose@latestAfter adding/modifying endpoints, regenerate the OpenAPI spec:
swag init --parseDependency --parseInternalThis generates:
docs/swagger.json- OpenAPI 3.1 specdocs/docs.go- Go bindings (don't edit manually)
Docs at: http://localhost:8080/swagger/index.html
Generate sqlc
sqlc generateRun migrations locally
GOOSE_DRIVER=postgres GOOSE_DBSTRING=postgres://admin:admin@localhost:9903/main GOOSE_MIGRATION_DIR=./internal/db/schema goose upRun migrations on host
GOOSE_DRIVER=postgres GOOSE_DBSTRING=postgres://${AUTH_USER}:${AUTH_PASS}@localhost:9903/main GOOSE_MIGRATION_DIR=./internal/db/schema ~/go/bin/goose upMIT