This is my first go lang. project i enjoy so much :).
and this service that brings gender information by name,
Written with https://go.dev/
-
Install go language from https://go.dev/dl/
-
Get clone project
-
Fill the env file like below
DATABASE_NAME=gender_dictionary
DATABASE_DSN=username:password@tcp(mysqlIp:port)
TABLE_NAME=gender
-
Run the following command in order
1.) go run mysql/db_config.go
2.) go run csv/csv_import.go
-
Run the following command
1.) go run gender.go
2.) Open your browser and request http://localhost:8081/gender?name=furkan
{ "success": true, "payload": { "name": "FURKAN", "gender": "M", "country": "TR" } }
Note: name
query parameter is required to get payload if you not gonna add name
query parameter probably can get error message
{
"success": false,
"error": {
"message": "Name is not exist"
}
}