TechLinF / tourist

tourist for spirit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tourist

Tourist for spirit and go-spirit

Install go-spirit

> go get github.com/go-spirit/go-spirit

Build all

> make pull && make all

Tourist 1 - todo-goja

combine component postapi and goja

Run

> ./todo-goja run --config configs/todo-goja/todo.conf

Test

Add task

> curl -X POST \
  http://127.0.0.1:8080/ \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'x-api: todo.task.new' \
  -H 'x-api-timeout: 1s' \
  -d '{
	"name":"hello spirit"
}'

output

{
    "code": 0,
    "result": {
        "id": "f44941d8-5c6f-4c44-a65a-2237bbf023fe"
    }
}

Get task

curl -X POST \
  http://127.0.0.1:8080/ \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'x-api: todo.task.get' \
  -H 'x-api-timeout: 30s' \
  -d '{
        "id": "f44941d8-5c6f-4c44-a65a-2237bbf023fe"
    }'

output

{
    "code": 0,
    "result": {
        "id": "f44941d8-5c6f-4c44-a65a-2237bbf023fe",
        "name":"hello spirit"
    }
}

Tourist 2 - todo-combined

combine component postapi and todo

Run

> ./todo-combined run --config configs/todo-combined/todo.conf

Test

Use Tourist 1's test-case to test this tourist

Tourist 3 - todo-split

combine component postapi and todo

Run

Before you run this part, please make sure you were updated the configs/todo-split/secret.conf to your own aliyun account, and you create mns queues of todo-task-listen and api-call-back

> ./todo-split run --config configs/todo-split/todo.conf
> ./postapi-split run --config configs/todo-split/postapi.conf

Test

Use Tourist 1's test-case to test this tourist

About

tourist for spirit

License:Apache License 2.0


Languages

Language:Makefile 55.4%Language:JavaScript 44.6%