fernandesleticia / go-agenda

Agenda Using Golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go Agenda

An Smart Application that provides a smart way to keep track of your life

Technologies

The project was developed using Golang,

Dependencies

  • gorilla/mux

go get -u github.com/gorilla/mux

  • logrus

go get -u github.com/sirupsen/logrus

  • gorm

go get -u github.com/jinzhu/gorm

  • Mysql driver

go get -u github.com/go-sql-driver/mysql

  • Mysql dialects

go get -u github.com/jinzhu/gorm/dialects/mysql

Creating database

  • Launch a MySQL container

docker run -d -p 3306:3306 --name mysql -e MYSQL_ROOT_PASSWORD=root mysql

docker exec -it mysql mysql -uroot -proot -e 'CREATE DATABASE agenda'

Testing

  • runing agenda
$ go run agenda.go
  • checking heath
$ curl -i localhost:8000/healthz
  • creating an item
$ curl -X POST -d "description=buy apples" localhost:8000/item
  • updating an item
$ curl -X POST -d "done=true" localhost:8000/update/1
  • deleting an item
$ curl -X DELETE localhost:8000/delete/1
  • getting done items
$ curl -X GET localhost:8000/done
  • getting pending items
$ curl -X GET localhost:8000/pending

About

Agenda Using Golang


Languages

Language:Go 100.0%