ruby_rabbitmq_janus 1.1.8 → 1.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +14 -0
- data/config/default.yml +5 -3
- data/config/requests/channel/README.md +29 -0
- data/config/requests/channel/answer.json +13 -0
- data/config/requests/channel/create.json +9 -0
- data/config/requests/channel/describe.json +10 -0
- data/config/requests/channel/destroy.json +10 -0
- data/config/requests/channel/exists.json +10 -0
- data/config/requests/channel/join.json +11 -0
- data/config/requests/channel/leave.json +11 -0
- data/config/requests/channel/list.json +9 -0
- data/config/requests/channel/offer.json +14 -0
- data/config/requests/channel/select.json +11 -0
- data/config/requests/channel/trickle.json +10 -0
- data/config/requests/peer/trickle.json +7 -0
- data/config/requests/videocast/join.json +12 -0
- data/config/requests/videocast/leave.json +11 -0
- data/config/ruby-rabbitmq-janus.yml +27 -0
- data/lib/generators/ruby_rabbitmq_janus/initializer_generator.rb +15 -24
- data/lib/generators/ruby_rabbitmq_janus/install_generator.rb +49 -0
- data/lib/rrj/info.rb +1 -1
- data/lib/rrj/init.rb +0 -2
- data/lib/rrj/rabbit/publish/listener.rb +38 -12
- data/lib/rrj/tools/config.rb +10 -6
- data/lib/rrj/tools/log.rb +5 -5
- data/spec/request/admin/request_handle_info_spec.rb +13 -0
- data/spec/request/admin/request_sessions_spec.rb +12 -0
- data/spec/request/base/request_attach_spec.rb +25 -0
- data/spec/request/base/request_create_spec.rb +17 -0
- data/spec/request/base/request_destroy_spec.rb +17 -0
- data/spec/request/base/request_detach_spec.rb +23 -0
- data/spec/request/base/request_info_spec.rb +17 -0
- data/spec/request/base/request_keepalive_spec.rb +17 -0
- data/spec/request/peer/request_trickle_spec.rb +42 -0
- data/spec/rrj/rrj_config_spec.rb +10 -0
- data/spec/rrj/rrj_log_spec.rb +21 -0
- data/spec/rrj/rrj_rabbitmq_spec.rb +18 -0
- data/spec/rrj/rrj_spec.rb +25 -0
- data/spec/spec_helper.rb +53 -0
- data/spec/support/aruba.rb +3 -0
- data/spec/support/examples.rb +83 -0
- data/spec/support/examples_peer.rb +18 -0
- data/spec/support/schemas/config/config.json +101 -0
- data/spec/support/schemas/config/rabbit.json +13 -0
- data/spec/support/schemas/request/admin/handle_info.json +17 -0
- data/spec/support/schemas/request/admin/sessions.json +13 -0
- data/spec/support/schemas/request/base/attach.json +19 -0
- data/spec/support/schemas/request/base/create.json +17 -0
- data/spec/support/schemas/request/base/destroy.json +13 -0
- data/spec/support/schemas/request/base/detach.json +13 -0
- data/spec/support/schemas/request/base/info.json +25 -0
- data/spec/support/schemas/request/base/keepalive.json +13 -0
- data/spec/support/schemas/request/channel/create.json +39 -0
- data/spec/support/schemas/request/channel/destroy.json +39 -0
- data/spec/support/schemas/request/channel/exist.json +41 -0
- data/spec/support/schemas/request/channel/list.json +37 -0
- data/spec/support/schemas/request/peer/trickle.json +21 -0
- metadata +57 -32
- data/.gitignore +0 -77
- data/.overcommit.yml +0 -12
- data/.reek +0 -7
- data/.rspec +0 -2
- data/.rubocop.yml +0 -12
- data/.travis.yml +0 -5
- data/.yardopts +0 -5
- data/CHANGELOG.md +0 -27
- data/CODE_OF_CONDUCT.md +0 -49
- data/README.md +0 -177
- data/rrj.gemspec +0 -41
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Simple request
|
4
|
+
shared_examples 'peer message_simple should match json empty' do
|
5
|
+
let(:message) { @gateway.message_simple(@type) }
|
6
|
+
|
7
|
+
it 'should match JSON empty' do
|
8
|
+
expect(message.to_json).to eq('{}')
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
shared_examples 'peer message_simple should match json schema' do
|
13
|
+
let(:message) { @gateway.message_simple(@type, true) }
|
14
|
+
|
15
|
+
it do
|
16
|
+
expect(message.to_json).to match_json_schema(@type)
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
{
|
2
|
+
"type": "object",
|
3
|
+
"properties": {
|
4
|
+
"rabbit": {
|
5
|
+
"type": "hash",
|
6
|
+
"properties": {
|
7
|
+
"host": { "type": "string" },
|
8
|
+
"port": { "type": "integer" },
|
9
|
+
"vhost": { "type": "string" },
|
10
|
+
"user": { "type": "string" },
|
11
|
+
"pass": { "type": "string" },
|
12
|
+
"admin_pass": { "type": "string" }
|
13
|
+
},
|
14
|
+
"required": [
|
15
|
+
"host",
|
16
|
+
"port",
|
17
|
+
"vhost",
|
18
|
+
"user",
|
19
|
+
"pass",
|
20
|
+
"admin_pass"
|
21
|
+
]
|
22
|
+
},
|
23
|
+
"queues": {
|
24
|
+
"type": "hash",
|
25
|
+
"properties": {
|
26
|
+
"queue_from": { "type": "string" },
|
27
|
+
"queue_to": { "type": "string" },
|
28
|
+
"admin": {
|
29
|
+
"type": "hash",
|
30
|
+
"properties": {
|
31
|
+
"queue_from": { "type": "string" },
|
32
|
+
"queue_to": { "type": "string" }
|
33
|
+
},
|
34
|
+
"required": [
|
35
|
+
"queue_from",
|
36
|
+
"queue_to"
|
37
|
+
]
|
38
|
+
}
|
39
|
+
},
|
40
|
+
"required": [
|
41
|
+
"queue_from",
|
42
|
+
"queue_to",
|
43
|
+
"admin"
|
44
|
+
]
|
45
|
+
},
|
46
|
+
"janus": {
|
47
|
+
"type": "hash",
|
48
|
+
"properties": {
|
49
|
+
"plugins": { "type": "hash" }
|
50
|
+
},
|
51
|
+
"required": [
|
52
|
+
"plugins"
|
53
|
+
]
|
54
|
+
},
|
55
|
+
"gem": {
|
56
|
+
"type": "hash",
|
57
|
+
"properties": {
|
58
|
+
"log": {
|
59
|
+
"type": "hash",
|
60
|
+
"properties": {
|
61
|
+
"level": { "type": "string" }
|
62
|
+
},
|
63
|
+
"required": [
|
64
|
+
"level"
|
65
|
+
]
|
66
|
+
},
|
67
|
+
"session": {
|
68
|
+
"type": "hash",
|
69
|
+
"properties": {
|
70
|
+
"keepalive": { "type": "integer" }
|
71
|
+
},
|
72
|
+
"required": [
|
73
|
+
"keepalive"
|
74
|
+
]
|
75
|
+
},
|
76
|
+
"thread": {
|
77
|
+
"type": "hash",
|
78
|
+
"properties": {
|
79
|
+
"enable": { "type" : "boolean" },
|
80
|
+
"number": { "type": "integer" }
|
81
|
+
},
|
82
|
+
"required": [
|
83
|
+
"enable",
|
84
|
+
"number"
|
85
|
+
]
|
86
|
+
}
|
87
|
+
},
|
88
|
+
"required": [
|
89
|
+
"log",
|
90
|
+
"session",
|
91
|
+
"thread"
|
92
|
+
]
|
93
|
+
}
|
94
|
+
},
|
95
|
+
"required": [
|
96
|
+
"rabbit",
|
97
|
+
"queues",
|
98
|
+
"janus",
|
99
|
+
"gem"
|
100
|
+
]
|
101
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"type": "object",
|
3
|
+
"properties": {
|
4
|
+
"routing_key": { "type": "string", "pattern": "to-janus" },
|
5
|
+
"correlation_id": { "type": "string" },
|
6
|
+
"content_type": { "type": "String", "pattern": "application/json" }
|
7
|
+
},
|
8
|
+
"required": [
|
9
|
+
"routing_key",
|
10
|
+
"correlation_id",
|
11
|
+
"content_type"
|
12
|
+
]
|
13
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{
|
2
|
+
"type": "object",
|
3
|
+
"properties": {
|
4
|
+
"janus": { "type": "string", "pattern": "success" },
|
5
|
+
"transaction": { "type": "string" },
|
6
|
+
"session_id": { "type": "integer" },
|
7
|
+
"handle_id": { "type": "integer" },
|
8
|
+
"info": { "type": "Hash" }
|
9
|
+
},
|
10
|
+
"required": [
|
11
|
+
"janus",
|
12
|
+
"transaction",
|
13
|
+
"session_id",
|
14
|
+
"handle_id",
|
15
|
+
"info"
|
16
|
+
]
|
17
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"type": "object",
|
3
|
+
"properties": {
|
4
|
+
"janus": { "type": "string", "pattern": "success" },
|
5
|
+
"session_id": { "type": "integer" },
|
6
|
+
"transaction": { "type": "string" },
|
7
|
+
"data": {
|
8
|
+
"type": "Hash",
|
9
|
+
"id": { "type": "integer" }
|
10
|
+
},
|
11
|
+
"handle_id": { "type": "integer" }
|
12
|
+
},
|
13
|
+
"required": [
|
14
|
+
"janus",
|
15
|
+
"session_id",
|
16
|
+
"transaction",
|
17
|
+
"data"
|
18
|
+
]
|
19
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{
|
2
|
+
"type": "object",
|
3
|
+
"properties": {
|
4
|
+
"janus": { "type": "string", "pattern": "success" },
|
5
|
+
"session_id": { "type": "integer" },
|
6
|
+
"transaction": { "type": "string" },
|
7
|
+
"data": {
|
8
|
+
"type": "Hash",
|
9
|
+
"id": { "type": "integer" }
|
10
|
+
}
|
11
|
+
},
|
12
|
+
"required": [
|
13
|
+
"janus",
|
14
|
+
"transaction",
|
15
|
+
"data"
|
16
|
+
]
|
17
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"type": "object",
|
3
|
+
"properties": {
|
4
|
+
"janus": { "type": "string", "pattern": "server_info" },
|
5
|
+
"transaction": { "type": "string" },
|
6
|
+
"name": { "type": "string" },
|
7
|
+
"version": { "type": "integer" },
|
8
|
+
"version_string": { "type": "string" },
|
9
|
+
"author": { "type": "string" },
|
10
|
+
"data_channel": { "type": "boolean" },
|
11
|
+
"transports": { "type": "hash" },
|
12
|
+
"plugins": { "type": "hash" }
|
13
|
+
},
|
14
|
+
"required": [
|
15
|
+
"janus",
|
16
|
+
"transaction",
|
17
|
+
"name",
|
18
|
+
"version",
|
19
|
+
"version_string",
|
20
|
+
"author",
|
21
|
+
"data_channels",
|
22
|
+
"transports",
|
23
|
+
"plugins"
|
24
|
+
]
|
25
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
{
|
2
|
+
"type": "object",
|
3
|
+
"properties": {
|
4
|
+
"janus": { "type": "string", "pattern": "success" },
|
5
|
+
"session_id": { "type": "integer" },
|
6
|
+
"transaction": { "type": "string" },
|
7
|
+
"sender": { "type": "integer" },
|
8
|
+
"plugindata": {
|
9
|
+
"type": "hash",
|
10
|
+
"properties": {
|
11
|
+
"data": {
|
12
|
+
"type": "hash",
|
13
|
+
"properties": {
|
14
|
+
"videocontrol": { "type": "string", "pattern": "created" },
|
15
|
+
"channel": { "type": "integer"}
|
16
|
+
},
|
17
|
+
"required": [
|
18
|
+
"videocontrol",
|
19
|
+
"channel"
|
20
|
+
]
|
21
|
+
},
|
22
|
+
"plugin": {
|
23
|
+
"type": "string"
|
24
|
+
}
|
25
|
+
},
|
26
|
+
"required": [
|
27
|
+
"plugin",
|
28
|
+
"data"
|
29
|
+
]
|
30
|
+
}
|
31
|
+
},
|
32
|
+
"required": [
|
33
|
+
"janus",
|
34
|
+
"session_id",
|
35
|
+
"sender",
|
36
|
+
"transaction",
|
37
|
+
"plugindata"
|
38
|
+
]
|
39
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
{
|
2
|
+
"type": "object",
|
3
|
+
"properties": {
|
4
|
+
"janus": { "type": "string", "pattern": "success" },
|
5
|
+
"session_id": { "type": "integer" },
|
6
|
+
"transaction": { "type": "string" },
|
7
|
+
"sender": { "type": "integer" },
|
8
|
+
"plugindata": {
|
9
|
+
"type": "hash",
|
10
|
+
"properties": {
|
11
|
+
"data": {
|
12
|
+
"type": "hash",
|
13
|
+
"properties": {
|
14
|
+
"videocontrol": { "type": "string", "pattern": "destroyed" },
|
15
|
+
"channel": { "type": "integer"}
|
16
|
+
},
|
17
|
+
"required": [
|
18
|
+
"videocontrol",
|
19
|
+
"channel"
|
20
|
+
]
|
21
|
+
},
|
22
|
+
"plugin": {
|
23
|
+
"type": "string"
|
24
|
+
}
|
25
|
+
},
|
26
|
+
"required": [
|
27
|
+
"data",
|
28
|
+
"plugin"
|
29
|
+
]
|
30
|
+
}
|
31
|
+
},
|
32
|
+
"required": [
|
33
|
+
"janus",
|
34
|
+
"session_id",
|
35
|
+
"sender",
|
36
|
+
"transaction",
|
37
|
+
"plugindata"
|
38
|
+
]
|
39
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
{
|
2
|
+
"type": "object",
|
3
|
+
"properties": {
|
4
|
+
"janus": { "type": "string", "pattern": "success" },
|
5
|
+
"session_id": { "type": "integer" },
|
6
|
+
"transaction": { "type": "string" },
|
7
|
+
"sender": { "type": "integer" },
|
8
|
+
"plugindata": {
|
9
|
+
"type": "hash",
|
10
|
+
"properties": {
|
11
|
+
"data": {
|
12
|
+
"type": "hash",
|
13
|
+
"properties": {
|
14
|
+
"videocontrol": { "type": "string", "pattern": "success" },
|
15
|
+
"channel": { "type": "integer"},
|
16
|
+
"exists": { "type": "boolean" }
|
17
|
+
},
|
18
|
+
"required": [
|
19
|
+
"videocontrol",
|
20
|
+
"channel",
|
21
|
+
"exists"
|
22
|
+
]
|
23
|
+
},
|
24
|
+
"plugin": {
|
25
|
+
"type": "string"
|
26
|
+
}
|
27
|
+
},
|
28
|
+
"required": [
|
29
|
+
"plugin",
|
30
|
+
"data"
|
31
|
+
]
|
32
|
+
}
|
33
|
+
},
|
34
|
+
"required": [
|
35
|
+
"janus",
|
36
|
+
"session_id",
|
37
|
+
"sender",
|
38
|
+
"transaction",
|
39
|
+
"plugindata"
|
40
|
+
]
|
41
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
{
|
2
|
+
"type": "object",
|
3
|
+
"properties": {
|
4
|
+
"janus": { "type": "string", "pattern": "success" },
|
5
|
+
"session_id": { "type": "integer" },
|
6
|
+
"transaction": { "type": "string" },
|
7
|
+
"sender": { "type": "integer" },
|
8
|
+
"plugindata": {
|
9
|
+
"type": "hash",
|
10
|
+
"properties": {
|
11
|
+
"data": {
|
12
|
+
"type": "hash",
|
13
|
+
"properties": {
|
14
|
+
"videocontrol": { "type": "string" },
|
15
|
+
"list": { "type": "array" }
|
16
|
+
},
|
17
|
+
"required": [
|
18
|
+
"videocontrol",
|
19
|
+
"list"
|
20
|
+
]
|
21
|
+
},
|
22
|
+
"plugin": { "type": "string" }
|
23
|
+
},
|
24
|
+
"required": [
|
25
|
+
"data",
|
26
|
+
"plugin"
|
27
|
+
]
|
28
|
+
}
|
29
|
+
},
|
30
|
+
"required": [
|
31
|
+
"janus",
|
32
|
+
"session_id",
|
33
|
+
"sender",
|
34
|
+
"transaction",
|
35
|
+
"plugindata"
|
36
|
+
]
|
37
|
+
}
|