godaner / go_ddd_webapp

my Golang DDD webapp example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CircleCI

my Golang DDD webapp example

Features

  • GAE/datastore
  • Multiple unique constaints on datastore
  • Layered Architecture
  • No framework library
  • Use negroni to handle HTTP
  • Use goon for autocaching

Boot

% dev_appserver.py config/app.yaml

Request examples

% curl -X POST -d '{"email": "foo@foo.test", "screen_name": "foo", "age": 17}' http://localhost:8080/users/
{"id":5629499534213120,"email":"foo@foo.test","screen_name":"foo","age":17,"created_at":"2018-04-08T10:21:07.617449Z","updated_at":"2018-04-08T10:21:07.617449Z"}

% curl http://localhost:8080/users/
[{"id":5629499534213120,"email":"foo@foo.test","screen_name":"foo","age":17,"created_at":"2018-04-08T10:21:07.617449Z","updated_at":"2018-04-08T10:21:07.617449Z"}]

% curl http://localhost:8080/users/5629499534213120
{"id":5629499534213120,"email":"foo@foo.test","screen_name":"foo","age":17,"created_at":"2018-04-08T10:21:07.617449Z","updated_at":"2018-04-08T10:21:07.617449Z"}

% curl -X POST -d '{"email": "foo@foo.test", "screen_name": "new", "age": 17}' http://localhost:8080/users/
{"error":"Unprocessable Entity"}

% curl -X POST -d '{"email": "new@foo.test", "screen_name": "foo", "age": 17}' http://localhost:8080/users/
{"error":"Unprocessable Entity"}

% curl -X PUT -d '{"screen_name": "new"}' http://localhost:8080/users/5629499534213120
{"id":5629499534213120,"email":"foo@foo.test","screen_name":"new","age":17,"created_at":"2018-04-08T10:21:07.617449Z","updated_at":"2018-04-08T10:22:59.279485Z"}

% curl -X DELETE http://localhost:8080/users/5629499534213120

% curl http://localhost:8080/users/
[]

About

my Golang DDD webapp example


Languages

Language:Go 96.9%Language:Shell 3.1%