dms

command
v0.0.0-...-380cd29 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: MIT Imports: 4 Imported by: 0

README

How to use DMS in Golang

DMS overview

Test task:

Develop a TODO system: API with CRUD operations:

  • create new task (id (int), alias (string), description (string), type (set of string: [urgent, important, general]), tags (set of srting: [personal, work, vacation]), timestamp (int), estimate-time (string), real-time (string), reminders (set of strings: ["3h", "15m"]))
  • read tasks, or one task by id/alias
  • update task
  • delete task

Preparation steps

  1. Prepare environment: Docker Docker Compose
  2. Create API to handles such type of calls (replace comments from app.go)
  3. Implement of interaction with database
  • implement DB driver
  • add support for docker container
  • add DB schema (if needed)
  • implement CRUD operations
  1. Handle the request

    test request: curl http://127.0.0.1:8080

  2. Prepare data to save (use SQLite3, switch from SQLite to PostgreSQL)

#create DB file for SQLite
touch sqltest.db

#build your solution
GOOS=linux go build -o app app.go
  1. Build & launch docker:
docker build -t testdms:latest .
docker images #find your image hash
docker run --rm -it -v sqlite.db:/app/sqlite.db <image-hash>
  1. Test request with data: curl -X POST -H 'Content-Type: application/json' -d '{"alias":"go-dms-workshop","desc":"Create app and try it with different DMS", "type":"important", "ts":1473837996,"tags":["Golang","Workshop","DMS"],"etime":"4h","rtime":"8h","reminders":["3h", "15m"]}' http://127.0.0.1:8080

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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