synchronous-controller

command module
v0.0.0-...-646cb8e Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: MIT Imports: 4 Imported by: 0

README

Synchronous Controller

リアルタイムなスライドを実現するためのめちゃくちゃすごい(自分調べ)Dapr appです。

Env

DB_USER=
DATABASE_NAME=
DB_PASSWORD=

Tests

  • 必要なもの
    • postgreSQL
# postgres start (homebrew onlu)
./tools/start_local_db.sh

# create db
create hello-slide-test -O postgres

# run test
./tools/db_test.sh [db username]

# delete db
dropdb hello-slide-test

# stop postgres
./tools/stop_local_db.sh

Websocket types

  1. セッション開始リクエスト(Host)

    • サーバーから同じ値で返答あり
    # req
    {
        "type": "0"
    }
    
    # res
    {
        "type": "0",
        "version": "1.0",
        "id": "",
    }
    
  2. セッション開始リクエスト(visitor)

    • サーバーから同じ値で返答あり
    # req
    {
        "type": "1",
        "id": ""
    }
    
    # res
    {
        "type": "1",
        "version": "1.0",
    }
    
  3. 参加者数取得

    # res
    {
        "type": "2",
        "visitors": "10",
    }
    
  4. 回答取得

    # res
    {
        "type": "3",
        "answers": [
            {
                "id": "",
                "user_id": "",
                "name": "",
                "answer": "",
            },
            {
                "id": "",
                "user_id": "",
                "name": "",
                "answer": "",
            },
            ...
        ]
    }
    
  5. 新しいトピック割当

    # req
    {
        "type": "4",
        "topic": "",
    }
    
  6. トピック送信(visitor)

    # res
    {
        "type": "5",
        "topic": "",
    }
    
  7. 回答(visitor)

    # req
    {
        "type": "6",
        "answer": "",
        "name": "",
    }
    

LICENSE

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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