Skip to content
kot13Public

About

JSON-RPC server with Golang

Topics

Resources

Stars

0 stars

Watchers

2 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Заготовка микросервиса с json-rpc

Запуск локально

$ gvt restore
$ go build ./main.go
$ ./main -c config-local.toml

-c - флаг для указания конфигурационного файла. По-умолчанию ищем config.toml

Ручки

Диагностика

Запрос:

$ curl -X GET "http://127.0.0.1:3042/health-check"

Тестовая

Запрос:

$ curl -X POST \
    http://127.0.0.1:3042/api/v1 \
    -H 'content-type: application/json' \
    -d '{
          "jsonrpc": "2.0",
          "method": "test.test",
          "params": {
          	"param": "test"
          },
          "id": 1
        }'

Ответ:

{
  "jsonrpc": "2.0",
  "result": {
    "param": "test"
  },
  "id": 1
}

About

JSON-RPC server with Golang

Topics

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages