test_task

command
v0.0.0-...-d05a6fb Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: MIT Imports: 14 Imported by: 0

README

Btc-Requester

Примеры работы:

Регистрация:
curl "http://localhost:9990/user/create?email=example0@mail.org&password=1qaz_"
[200] {"status":"Ok"}
Повторная регистрация:
curl "http://localhost:9990/user/create?email=example0@mail.org&password=1qaz_"
{"status":"Email already used"}
Логин:
curl "http://localhost:9990/user/login?email=example0@mail.org&password=1qaz_"
[200] {"status":"Ok","token":"kuap0bzu0qd1"}
Запрос цены:
curl "http://localhost:9990/btcRate?token=kuap0bzu0qd1"
curl "http://localhost:9990/btcRate" -H "X-API-Key: kuap0bzu0qd1"
[200] {"status":"Ok","token":"kuap0bzu0qd1"}
Неудачные запросы цены:
curl "http://localhost:9990/btcRate?token="
[400] {"status":"Missing token"}
curl "http://localhost:9990/btcRate?token=WRONG_TOKEN"
[403] {"status":"Invalid token"}

Архитектура

В идеале архитектура проекта должна быть приблизительно такой:

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