Discover Packages
github.com/morikuni/failure-example/simple-crud
module
Version:
v0.0.0-...-557a82b
Opens a new window with list of versions in this module.
Published: May 17, 2019
License: MIT
Opens a new window with license information.
README
README
¶
Simple CRUD Application
Example app for handling application errors with github.com/morikuni/failure .
The application is simple CRUD application which operate with key like a key-value store.
Since it's just an exmple, there are race condition problem when multiple clients request for the same key.
Structure
Generated by github.com/kisielk/godepgraph .
How to try?
Start Server
make start
then, call api
curl -i "http://localhost:8080/create?key=a&value=1"
Stop Server
Press Ctrl-C
, then
make stop
API
/create
Request
name
type
description
key
string
key
value
int
value
Response
code
description
200
message created
is returned
400
key or value are invalid
409
already exists
/read
Parameter
name
type
description
key
string
key
Response
code
description
200
value for the key is returned
400
key is invalid
404
no such key
/update
Parameter
name
type
description
key
string
key
value
int
value
Response
code
description
200
message updated
is returned
400
key or value are invalid
404
no such key
/delete
Parameter
name
type
description
key
string
key
Response
code
description
200
message deleted
is returned
400
key is invalid
404
no such key
Expand ▾
Collapse ▴
Directories
¶
cmd
Click to show internal directories.
Click to hide internal directories.