This is a simple service that validates credit card numbers using the Luhn algorithm. It is an educational project that I created to learn more about the Go programming language and gin framework.
To install the service, you need to have Go installed on your machine. You can download it from the official website.
go run cmd/card-service/main.go
go build -o card-service cmd/card-service/main.go
./card-service
docker build -t card-service .
docker run --name card-service -p 8080:8080 --env-file .env card-service
It returns a simple pong message.
{
"message": "pong"
}
It validates a credit card number using the Luhn algorithm.
{
"card_number": "4111111111111111"
}
{
"valid": true
}
go test ./internal/...