Pet API
This is web api for Pet store created using Go language.
- Go language
- MySql
- GORM: Go ORM
- Go has good performance almost like other lower level languages but it is more simple and reliable
- GORM currently doesn't support MariaDB so i choose MySql
- This is the most mature Object Relational Mapping (ORM) library for Go
- Go runtime
- MySql server
- Main function: /cmd/petapi/petapi.go
- Controllers: /cmd/petapi/controllers
- Models: /cmd/petapi/models
- Repository: /cmd/petapi/repository
- Helper method: /cmd/petapi/helpers
- Test method: /test
- Database connection string is still hardcoded, so please modify: cmd/petapi/models/init.go Current connection string: "root:MyNewPass@tcp(127.0.0.1:3306)/petapi?charset=utf8&parseTime=True&loc=Local"
- Build project: go build cmd/petapi/petapi.go
- Run project: go run cmd/petapi/petapi.go
- Api URL: http://localhost:8000/pet