Skip to content

cpbotha/dbwriter_go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Minimal database writer API with gin, gorm and swagger put together by a go newbie in 2021 to test the developer experience.

See the blog post Developer experience setting up a minimal API in Go, C# and Python at vxlabs.com for more information.

See you, https://charlbotha.com/

quickstart

go run

... and then browse to localhost:8080/swagger/index.html

Update swagger docs

# install the swag command which you'll need to update swagger docs
go install github.com/swaggo/swag/cmd/swag@latest
# whenever you update code / annotated comments
~/go/bin/swag init
# in theory this should install deps listed in go.sum if necessary
go run

References

Examples of adding swagger docs to simple gin apps with bare controller functions:

How I got started

Reminders because I'm a newbie:

go init
go get -u github.com/jinzhu/gorm
go get github.com/jinzhu/gorm/dialects/sqlite
go get github.com/gin-gonic/gin
go install github.com/swaggo/swag/cmd/swag@latest
~/go/bin/swag init # setup docs/ dir; you have to run this every time you update annotations
go get -v github.com/swaggo/gin-swagger

About

minimal API made with Go, GORM, GIN and swaggo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages