Skip to content
This repository was archived by the owner on Dec 23, 2025. It is now read-only.

Latest commit

 

History

History
78 lines (58 loc) · 1.88 KB

File metadata and controls

78 lines (58 loc) · 1.88 KB

Srvc-Scrapping

Build

# Build the application
go build -o bin/api src/cmd/main.go

# Build with specific OS/Architecture
GOOS=linux GOARCH=amd64 go build -o bin/api-linux src/cmd/main.go

# Build for production (optimized)
go build -ldflags="-w -s" -o bin/api src/cmd/main.go

Dev

# Run in development mode
go run src/cmd/main.go

# Run with hot reload (install air first: go install github.com/cosmtrek/air@latest)
air

# Format code
go fmt ./...

# Vet code for issues
go vet ./...

# Download and tidy dependencies
go mod tidy
go mod download

Test

## Test with race condition and coverage
go test -v -cover -race  -coverprofile=coverage.out ./...

## Analyze coverage
go tool cover -html=coverage.out

Tools

# Install linting tools
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest

# Run linter
golangci-lint run

# Security audit
go install github.com/securecodewarrior/govulncheck@latest
govulncheck ./...

# Generate documentation
go install golang.org/x/tools/cmd/godoc@latest
godoc -http=:6060

Variables

Name Default Value / Example
PORT 8080
ENVIRONMENT prod
DATABASE_USERNAME username
DATABASE_PASSWORD password
DATABASE_HOST localhost:5432
DATABASE_NAME repo_account
KAFKA_BROKERS localhost:9092
KAFKA_RSS_AGGREGATE_TOPIC rss-aggregate
KAFKA_GROUP_ID srvc-scrapping-group
KAFKA_ARTICLE_COMMAND_TOPIC new-articles-command
WEBHOOK_URL (empty)