simple-crud

module
v0.0.0-...-557a82b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2019 License: MIT

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

dependency

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

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL