upfluence-thrift 2.3.1 → 2.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/thrift/definition.rb +29 -8
- data/lib/thrift/processor.rb +96 -0
- data/lib/thrift/protocol/json_protocol.rb +65 -1
- data/lib/thrift/types/annotation/deprecation/deprecation_constants.rb +17 -0
- data/lib/thrift/types/annotation/deprecation/deprecation_types.rb +44 -0
- data/lib/thrift/types/annotation/naming/naming.rb +23 -0
- data/lib/thrift/types/annotation/naming/naming_constants.rb +17 -0
- data/lib/thrift/types/annotation/naming/naming_types.rb +59 -0
- data/lib/thrift/types/known/{any.rb → any/any.rb} +1 -1
- data/lib/thrift/types/known/{any_constants.rb → any/any_constants.rb} +2 -2
- data/lib/thrift/types/known/{any_types.rb → any/any_types.rb} +21 -3
- data/lib/thrift/types/known/{duration.rb → duration/duration.rb} +1 -1
- data/lib/thrift/types/known/{duration_constants.rb → duration/duration_constants.rb} +2 -2
- data/lib/thrift/types/known/{duration_types.rb → duration/duration_types.rb} +21 -3
- data/lib/thrift/types/known/{timestamp.rb → timestamp/timestamp.rb} +1 -1
- data/lib/thrift/types/known/{timestamp_constants.rb → timestamp/timestamp_constants.rb} +2 -2
- data/lib/thrift/types/known/{timestamp_types.rb → timestamp/timestamp_types.rb} +21 -3
- data/lib/thrift/types/{value.rb → value/value.rb} +1 -1
- data/lib/thrift/types/{value_constants.rb → value/value_constants.rb} +2 -2
- data/lib/thrift/types/{value_types.rb → value/value_types.rb} +135 -15
- data/lib/thrift.rb +5 -0
- data/spec/json_protocol_spec.rb +17 -0
- data/spec/spec_helper.rb +17 -17
- metadata +45 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fb37f79c1ff995e30d8891a0efe29ffe64d638a3dd5968c27a8e31363c14af6
|
4
|
+
data.tar.gz: 698761793f4c21b60d6cf99524230b039bab1bedf5c247fe10970487278f290f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c02b5806633a061e286f0f6b4bd93fe8c0d4a82308d7f8c0b5939b9823aeca9c0c4a38200fe241fac608900499e813dced8eec9f2d9a490d7ec42d0735fd7554
|
7
|
+
data.tar.gz: 80322343ae8247133b175e267206a9eeaf26868918ac52b71d06702ba98b946e06b69a0d2f09842fb8ff285bcaad25e566da7747cf007f69217432b8fedff170
|
data/lib/thrift/definition.rb
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
module Thrift
|
2
|
+
class DefaultCanonicalNameExtractor
|
3
|
+
class << self
|
4
|
+
def extract(definition)
|
5
|
+
[definition.struct_type]
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
2
10
|
class StructDefinition
|
3
11
|
attr_reader :klass
|
4
12
|
|
@@ -6,6 +14,14 @@ module Thrift
|
|
6
14
|
@klass = klass
|
7
15
|
end
|
8
16
|
|
17
|
+
def structured_annotations
|
18
|
+
@klass::STRUCTURED_ANNOTATIONS
|
19
|
+
end
|
20
|
+
|
21
|
+
def legacy_annotations
|
22
|
+
@klass::LEGACY_ANNOTATIONS
|
23
|
+
end
|
24
|
+
|
9
25
|
def namespace
|
10
26
|
@klass::NAMESPACE
|
11
27
|
end
|
@@ -17,15 +33,15 @@ module Thrift
|
|
17
33
|
def struct_type
|
18
34
|
"#{namespace}.#{name}"
|
19
35
|
end
|
20
|
-
end
|
21
|
-
|
22
|
-
class ServiceDefinition < StructDefinition
|
23
|
-
attr_reader :klass
|
24
36
|
|
25
|
-
def
|
26
|
-
|
37
|
+
def canonical_names
|
38
|
+
CANONICAL_NAME_EXTRACTORS.reduce([]) do |acc, cur|
|
39
|
+
acc + cur.extract(self)
|
40
|
+
end
|
27
41
|
end
|
42
|
+
end
|
28
43
|
|
44
|
+
class ServiceDefinition < StructDefinition
|
29
45
|
def client_class
|
30
46
|
@klass::Client
|
31
47
|
end
|
@@ -34,8 +50,8 @@ module Thrift
|
|
34
50
|
@klass::Processor
|
35
51
|
end
|
36
52
|
|
37
|
-
def
|
38
|
-
|
53
|
+
def name
|
54
|
+
service
|
39
55
|
end
|
40
56
|
|
41
57
|
def service
|
@@ -49,6 +65,7 @@ module Thrift
|
|
49
65
|
|
50
66
|
STRUCT_DEFINITIONS = {}
|
51
67
|
SERVICE_DEFINITIONS = {}
|
68
|
+
CANONICAL_NAME_EXTRACTORS = [DefaultCanonicalNameExtractor]
|
52
69
|
|
53
70
|
class << self
|
54
71
|
def register_struct_type(klass)
|
@@ -60,5 +77,9 @@ module Thrift
|
|
60
77
|
definition = ServiceDefinition.new(klass)
|
61
78
|
SERVICE_DEFINITIONS[definition.service_type] = definition
|
62
79
|
end
|
80
|
+
|
81
|
+
def register_canonical_name_extractor(klass)
|
82
|
+
CANONICAL_NAME_EXTRACTORS << klass
|
83
|
+
end
|
63
84
|
end
|
64
85
|
end
|
data/lib/thrift/processor.rb
CHANGED
@@ -19,13 +19,109 @@
|
|
19
19
|
|
20
20
|
module Thrift
|
21
21
|
module Processor
|
22
|
+
class BaseProcessorFunction
|
23
|
+
def initialize(fname, middleware, args_klass, method)
|
24
|
+
@fname = fname
|
25
|
+
@middleware = middleware
|
26
|
+
@args_klass = args_klass
|
27
|
+
@method = method
|
28
|
+
end
|
29
|
+
|
30
|
+
protected
|
31
|
+
|
32
|
+
def read_args(iprot)
|
33
|
+
args = @args_klass.new
|
34
|
+
|
35
|
+
args.read(iprot)
|
36
|
+
iprot.read_message_end
|
37
|
+
|
38
|
+
args
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
class BinaryProcessorFunction < BaseProcessorFunction
|
43
|
+
def process(seqid, iprot, oprot)
|
44
|
+
execute(seqid, iprot, oprot)
|
45
|
+
|
46
|
+
true
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def execute(seqid, iprot, oprot)
|
52
|
+
args = read_args(iprot)
|
53
|
+
|
54
|
+
result = @middleware.handle_binary(@fname, args) do |args|
|
55
|
+
@method.call(args)
|
56
|
+
end
|
57
|
+
|
58
|
+
write_result(result, oprot, seqid)
|
59
|
+
rescue => e
|
60
|
+
write_exception(e, oprot, seqid)
|
61
|
+
end
|
62
|
+
|
63
|
+
def write_exception(exception, oprot, seqid)
|
64
|
+
oprot.write_message_begin(@fname, MessageTypes::EXCEPTION, seqid)
|
65
|
+
|
66
|
+
unless exception.is_a? ApplicationException
|
67
|
+
exception = ApplicationException.new(
|
68
|
+
ApplicationException::INTERNAL_ERROR,
|
69
|
+
"Internal error processing #{@fname}: #{exception.class}: #{exception}"
|
70
|
+
)
|
71
|
+
end
|
72
|
+
|
73
|
+
exception.write(oprot)
|
74
|
+
oprot.write_message_end
|
75
|
+
oprot.trans.flush
|
76
|
+
end
|
77
|
+
|
78
|
+
def write_result(result, oprot, seqid)
|
79
|
+
oprot.write_message_begin(@fname, MessageTypes::REPLY, seqid)
|
80
|
+
result.write(oprot)
|
81
|
+
oprot.write_message_end
|
82
|
+
oprot.trans.flush
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
class UnaryProcessorFunction < BaseProcessorFunction
|
87
|
+
def process(_seqid, iprot, _oprot)
|
88
|
+
args = read_args(iprot)
|
89
|
+
|
90
|
+
@middleware.handle_unary(@fname, args) do |args|
|
91
|
+
@method.call(args)
|
92
|
+
end
|
93
|
+
|
94
|
+
true
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
22
98
|
def initialize(handler, middlewares = [])
|
23
99
|
@handler = handler
|
24
100
|
@middleware = Middleware.wrap(middlewares)
|
101
|
+
|
102
|
+
@functions = if self.class.const_defined?(:METHODS)
|
103
|
+
self.class::METHODS.reduce({}) do |acc, (key, args)|
|
104
|
+
klass = args[:oneway] ? UnaryProcessorFunction : BinaryProcessorFunction
|
105
|
+
|
106
|
+
acc.merge key => klass.new(
|
107
|
+
key,
|
108
|
+
@middleware,
|
109
|
+
args[:args_klass],
|
110
|
+
method("execute_#{key}")
|
111
|
+
)
|
112
|
+
end
|
113
|
+
end || {}
|
25
114
|
end
|
26
115
|
|
27
116
|
def process(iprot, oprot)
|
28
117
|
name, _type, seqid = iprot.read_message_begin
|
118
|
+
|
119
|
+
func = @functions[name]
|
120
|
+
|
121
|
+
return func.process(seqid, iprot, oprot) if func
|
122
|
+
|
123
|
+
# TODO: once all the stubs will be generated w thrift >=2.5 the next lines
|
124
|
+
# can be deleted
|
29
125
|
if respond_to?("process_#{name}")
|
30
126
|
begin
|
31
127
|
send("process_#{name}", seqid, iprot, oprot)
|
@@ -761,9 +761,73 @@ module Thrift
|
|
761
761
|
end
|
762
762
|
end
|
763
763
|
|
764
|
+
class SimpleJsonProtocol < JsonProtocol
|
765
|
+
READ_EXCEPTION = ProtocolException.new(
|
766
|
+
ProtocolException::NOT_IMPLEMENTED,
|
767
|
+
'op not implemented'
|
768
|
+
)
|
769
|
+
|
770
|
+
def write_message_begin(name, _type, _seqid)
|
771
|
+
write_json_object_start
|
772
|
+
write_json_string(name)
|
773
|
+
end
|
774
|
+
|
775
|
+
def read_message_begin
|
776
|
+
raise READ_EXCEPTION
|
777
|
+
end
|
778
|
+
|
779
|
+
def write_message_end
|
780
|
+
write_json_object_end
|
781
|
+
end
|
782
|
+
|
783
|
+
def write_field_begin(name, _type, _id)
|
784
|
+
write_json_string(name)
|
785
|
+
end
|
786
|
+
|
787
|
+
def read_field_begin
|
788
|
+
raise READ_EXCEPTION
|
789
|
+
end
|
790
|
+
|
791
|
+
def write_field_end; end
|
792
|
+
|
793
|
+
def write_map_begin(_ktype, _vtype, _size)
|
794
|
+
write_json_object_start
|
795
|
+
end
|
796
|
+
|
797
|
+
def read_map_begin
|
798
|
+
raise READ_EXCEPTION
|
799
|
+
end
|
800
|
+
|
801
|
+
def write_map_end
|
802
|
+
write_json_object_end
|
803
|
+
end
|
804
|
+
|
805
|
+
def write_list_begin(_etype, _size)
|
806
|
+
write_json_array_start
|
807
|
+
end
|
808
|
+
|
809
|
+
def read_list_begin
|
810
|
+
raise READ_EXCEPTION
|
811
|
+
end
|
812
|
+
|
813
|
+
def write_set_begin(_etype, _size)
|
814
|
+
write_json_array_start
|
815
|
+
end
|
816
|
+
|
817
|
+
def read_set_begin
|
818
|
+
raise READ_EXCEPTION
|
819
|
+
end
|
820
|
+
end
|
821
|
+
|
822
|
+
class SimpleJsonProtocolFactory < BaseProtocolFactory
|
823
|
+
def get_protocol(trans)
|
824
|
+
Thrift::SimpleJsonProtocol.new(trans)
|
825
|
+
end
|
826
|
+
end
|
827
|
+
|
764
828
|
class JsonProtocolFactory < BaseProtocolFactory
|
765
829
|
def get_protocol(trans)
|
766
|
-
|
830
|
+
Thrift::JsonProtocol.new(trans)
|
767
831
|
end
|
768
832
|
end
|
769
833
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#
|
2
|
+
# Autogenerated by Thrift Compiler (2.5.4-upfluence)
|
3
|
+
#
|
4
|
+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'thrift'
|
8
|
+
require 'thrift/types/annotation/deprecation/deprecation_types'
|
9
|
+
|
10
|
+
module Thrift
|
11
|
+
module Types
|
12
|
+
module Annotation
|
13
|
+
module Deprecation
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#
|
2
|
+
# Autogenerated by Thrift Compiler (2.5.4-upfluence)
|
3
|
+
#
|
4
|
+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'thrift'
|
8
|
+
|
9
|
+
module Thrift
|
10
|
+
module Types
|
11
|
+
module Annotation
|
12
|
+
module Deprecation
|
13
|
+
class Deprecated; end
|
14
|
+
|
15
|
+
class Deprecated
|
16
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
17
|
+
|
18
|
+
NAME = 'Deprecated'.freeze
|
19
|
+
NAMESPACE = 'types.annotation.deprecation'.freeze
|
20
|
+
|
21
|
+
LEGACY_ANNOTATIONS = {
|
22
|
+
}.freeze
|
23
|
+
|
24
|
+
STRUCTURED_ANNOTATIONS = [
|
25
|
+
].freeze
|
26
|
+
|
27
|
+
|
28
|
+
FIELDS = {
|
29
|
+
|
30
|
+
}
|
31
|
+
|
32
|
+
def struct_fields; FIELDS; end
|
33
|
+
|
34
|
+
def validate
|
35
|
+
end
|
36
|
+
|
37
|
+
::Thrift::Struct.generate_accessors self
|
38
|
+
::Thrift.register_struct_type self
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'thrift/types/annotation/naming/naming_types'
|
2
|
+
|
3
|
+
module Thrift
|
4
|
+
module Types
|
5
|
+
module Annotation
|
6
|
+
module Naming
|
7
|
+
class CanonicalNameExtractor
|
8
|
+
class << self
|
9
|
+
def extract(definition)
|
10
|
+
definition.structured_annotations.select do |sa|
|
11
|
+
sa.is_a? PreviouslyKnownAs
|
12
|
+
end.map do |pka|
|
13
|
+
"#{pka.namespace_ || definition.namespace}.#{pka.name || definition.name}"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
::Thrift.register_canonical_name_extractor self
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#
|
2
|
+
# Autogenerated by Thrift Compiler (2.5.4-upfluence)
|
3
|
+
#
|
4
|
+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'thrift'
|
8
|
+
require 'thrift/types/annotation/naming/naming_types'
|
9
|
+
|
10
|
+
module Thrift
|
11
|
+
module Types
|
12
|
+
module Annotation
|
13
|
+
module Naming
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
#
|
2
|
+
# Autogenerated by Thrift Compiler (2.5.4-upfluence)
|
3
|
+
#
|
4
|
+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'thrift'
|
8
|
+
|
9
|
+
module Thrift
|
10
|
+
module Types
|
11
|
+
module Annotation
|
12
|
+
module Naming
|
13
|
+
class PreviouslyKnownAs; end
|
14
|
+
|
15
|
+
class PreviouslyKnownAs
|
16
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
17
|
+
|
18
|
+
NAME = 'PreviouslyKnownAs'.freeze
|
19
|
+
NAMESPACE = 'types.annotation.naming'.freeze
|
20
|
+
|
21
|
+
LEGACY_ANNOTATIONS = {
|
22
|
+
}.freeze
|
23
|
+
|
24
|
+
STRUCTURED_ANNOTATIONS = [
|
25
|
+
].freeze
|
26
|
+
|
27
|
+
THRIFT_FIELD_INDEX_NAMESPACE_ = 1
|
28
|
+
THRIFT_FIELD_INDEX_NAME = 2
|
29
|
+
|
30
|
+
THRIFT_FIELD_NAMESPACE__LEGACY_ANNOTATIONS = {
|
31
|
+
}.freeze
|
32
|
+
|
33
|
+
THRIFT_FIELD_NAMESPACE__STRUCTURED_ANNOTATIONS = [
|
34
|
+
].freeze
|
35
|
+
|
36
|
+
THRIFT_FIELD_NAME_LEGACY_ANNOTATIONS = {
|
37
|
+
}.freeze
|
38
|
+
|
39
|
+
THRIFT_FIELD_NAME_STRUCTURED_ANNOTATIONS = [
|
40
|
+
].freeze
|
41
|
+
|
42
|
+
FIELDS = {
|
43
|
+
THRIFT_FIELD_INDEX_NAMESPACE_ => {type: ::Thrift::Types::STRING, name: 'namespace_', optional: true, legacy_annotations: THRIFT_FIELD_NAMESPACE__LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_NAMESPACE__STRUCTURED_ANNOTATIONS},
|
44
|
+
THRIFT_FIELD_INDEX_NAME => {type: ::Thrift::Types::STRING, name: 'name', optional: true, legacy_annotations: THRIFT_FIELD_NAME_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_NAME_STRUCTURED_ANNOTATIONS}
|
45
|
+
}
|
46
|
+
|
47
|
+
def struct_fields; FIELDS; end
|
48
|
+
|
49
|
+
def validate
|
50
|
+
end
|
51
|
+
|
52
|
+
::Thrift::Struct.generate_accessors self
|
53
|
+
::Thrift.register_struct_type self
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
#
|
2
|
-
# Autogenerated by Thrift Compiler (2.
|
2
|
+
# Autogenerated by Thrift Compiler (2.5.4-upfluence)
|
3
3
|
#
|
4
4
|
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
5
|
#
|
6
6
|
|
7
7
|
require 'thrift'
|
8
|
-
require 'any_types'
|
8
|
+
require 'thrift/types/known/any/any_types'
|
9
9
|
|
10
10
|
module Thrift
|
11
11
|
module Types
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Autogenerated by Thrift Compiler (2.
|
2
|
+
# Autogenerated by Thrift Compiler (2.5.4-upfluence)
|
3
3
|
#
|
4
4
|
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
5
|
#
|
@@ -18,12 +18,30 @@ module Thrift
|
|
18
18
|
NAME = 'Any'.freeze
|
19
19
|
NAMESPACE = 'types.known.any'.freeze
|
20
20
|
|
21
|
+
LEGACY_ANNOTATIONS = {
|
22
|
+
}.freeze
|
23
|
+
|
24
|
+
STRUCTURED_ANNOTATIONS = [
|
25
|
+
].freeze
|
26
|
+
|
21
27
|
THRIFT_FIELD_INDEX_TYPE = 1
|
22
28
|
THRIFT_FIELD_INDEX_VALUE = 2
|
23
29
|
|
30
|
+
THRIFT_FIELD_TYPE_LEGACY_ANNOTATIONS = {
|
31
|
+
}.freeze
|
32
|
+
|
33
|
+
THRIFT_FIELD_TYPE_STRUCTURED_ANNOTATIONS = [
|
34
|
+
].freeze
|
35
|
+
|
36
|
+
THRIFT_FIELD_VALUE_LEGACY_ANNOTATIONS = {
|
37
|
+
}.freeze
|
38
|
+
|
39
|
+
THRIFT_FIELD_VALUE_STRUCTURED_ANNOTATIONS = [
|
40
|
+
].freeze
|
41
|
+
|
24
42
|
FIELDS = {
|
25
|
-
THRIFT_FIELD_INDEX_TYPE => {type: ::Thrift::Types::STRING, name: 'type'},
|
26
|
-
THRIFT_FIELD_INDEX_VALUE => {type: ::Thrift::Types::STRING, name: 'value', binary: true}
|
43
|
+
THRIFT_FIELD_INDEX_TYPE => {type: ::Thrift::Types::STRING, name: 'type', legacy_annotations: THRIFT_FIELD_TYPE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_TYPE_STRUCTURED_ANNOTATIONS},
|
44
|
+
THRIFT_FIELD_INDEX_VALUE => {type: ::Thrift::Types::STRING, name: 'value', binary: true, legacy_annotations: THRIFT_FIELD_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_VALUE_STRUCTURED_ANNOTATIONS}
|
27
45
|
}
|
28
46
|
|
29
47
|
def struct_fields; FIELDS; end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
#
|
2
|
-
# Autogenerated by Thrift Compiler (2.
|
2
|
+
# Autogenerated by Thrift Compiler (2.5.4-upfluence)
|
3
3
|
#
|
4
4
|
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
5
|
#
|
6
6
|
|
7
7
|
require 'thrift'
|
8
|
-
require 'duration_types'
|
8
|
+
require 'thrift/types/known/duration/duration_types'
|
9
9
|
|
10
10
|
module Thrift
|
11
11
|
module Types
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Autogenerated by Thrift Compiler (2.
|
2
|
+
# Autogenerated by Thrift Compiler (2.5.4-upfluence)
|
3
3
|
#
|
4
4
|
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
5
|
#
|
@@ -18,12 +18,30 @@ module Thrift
|
|
18
18
|
NAME = 'Duration'.freeze
|
19
19
|
NAMESPACE = 'types.known.duration'.freeze
|
20
20
|
|
21
|
+
LEGACY_ANNOTATIONS = {
|
22
|
+
}.freeze
|
23
|
+
|
24
|
+
STRUCTURED_ANNOTATIONS = [
|
25
|
+
].freeze
|
26
|
+
|
21
27
|
THRIFT_FIELD_INDEX_SECONDS = 1
|
22
28
|
THRIFT_FIELD_INDEX_NANOS = 2
|
23
29
|
|
30
|
+
THRIFT_FIELD_SECONDS_LEGACY_ANNOTATIONS = {
|
31
|
+
}.freeze
|
32
|
+
|
33
|
+
THRIFT_FIELD_SECONDS_STRUCTURED_ANNOTATIONS = [
|
34
|
+
].freeze
|
35
|
+
|
36
|
+
THRIFT_FIELD_NANOS_LEGACY_ANNOTATIONS = {
|
37
|
+
}.freeze
|
38
|
+
|
39
|
+
THRIFT_FIELD_NANOS_STRUCTURED_ANNOTATIONS = [
|
40
|
+
].freeze
|
41
|
+
|
24
42
|
FIELDS = {
|
25
|
-
THRIFT_FIELD_INDEX_SECONDS => {type: ::Thrift::Types::I64, name: 'seconds'},
|
26
|
-
THRIFT_FIELD_INDEX_NANOS => {type: ::Thrift::Types::I32, name: 'nanos'}
|
43
|
+
THRIFT_FIELD_INDEX_SECONDS => {type: ::Thrift::Types::I64, name: 'seconds', legacy_annotations: THRIFT_FIELD_SECONDS_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_SECONDS_STRUCTURED_ANNOTATIONS},
|
44
|
+
THRIFT_FIELD_INDEX_NANOS => {type: ::Thrift::Types::I32, name: 'nanos', legacy_annotations: THRIFT_FIELD_NANOS_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_NANOS_STRUCTURED_ANNOTATIONS}
|
27
45
|
}
|
28
46
|
|
29
47
|
def struct_fields; FIELDS; end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
#
|
2
|
-
# Autogenerated by Thrift Compiler (2.
|
2
|
+
# Autogenerated by Thrift Compiler (2.5.4-upfluence)
|
3
3
|
#
|
4
4
|
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
5
|
#
|
6
6
|
|
7
7
|
require 'thrift'
|
8
|
-
require 'timestamp_types'
|
8
|
+
require 'thrift/types/known/timestamp/timestamp_types'
|
9
9
|
|
10
10
|
module Thrift
|
11
11
|
module Types
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Autogenerated by Thrift Compiler (2.
|
2
|
+
# Autogenerated by Thrift Compiler (2.5.4-upfluence)
|
3
3
|
#
|
4
4
|
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
5
|
#
|
@@ -18,12 +18,30 @@ module Thrift
|
|
18
18
|
NAME = 'Timestamp'.freeze
|
19
19
|
NAMESPACE = 'types.known.timestamp'.freeze
|
20
20
|
|
21
|
+
LEGACY_ANNOTATIONS = {
|
22
|
+
}.freeze
|
23
|
+
|
24
|
+
STRUCTURED_ANNOTATIONS = [
|
25
|
+
].freeze
|
26
|
+
|
21
27
|
THRIFT_FIELD_INDEX_SECONDS = 1
|
22
28
|
THRIFT_FIELD_INDEX_NANOS = 2
|
23
29
|
|
30
|
+
THRIFT_FIELD_SECONDS_LEGACY_ANNOTATIONS = {
|
31
|
+
}.freeze
|
32
|
+
|
33
|
+
THRIFT_FIELD_SECONDS_STRUCTURED_ANNOTATIONS = [
|
34
|
+
].freeze
|
35
|
+
|
36
|
+
THRIFT_FIELD_NANOS_LEGACY_ANNOTATIONS = {
|
37
|
+
}.freeze
|
38
|
+
|
39
|
+
THRIFT_FIELD_NANOS_STRUCTURED_ANNOTATIONS = [
|
40
|
+
].freeze
|
41
|
+
|
24
42
|
FIELDS = {
|
25
|
-
THRIFT_FIELD_INDEX_SECONDS => {type: ::Thrift::Types::I64, name: 'seconds'},
|
26
|
-
THRIFT_FIELD_INDEX_NANOS => {type: ::Thrift::Types::I32, name: 'nanos'}
|
43
|
+
THRIFT_FIELD_INDEX_SECONDS => {type: ::Thrift::Types::I64, name: 'seconds', legacy_annotations: THRIFT_FIELD_SECONDS_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_SECONDS_STRUCTURED_ANNOTATIONS},
|
44
|
+
THRIFT_FIELD_INDEX_NANOS => {type: ::Thrift::Types::I32, name: 'nanos', legacy_annotations: THRIFT_FIELD_NANOS_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_NANOS_STRUCTURED_ANNOTATIONS}
|
27
45
|
}
|
28
46
|
|
29
47
|
def struct_fields; FIELDS; end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
#
|
2
|
-
# Autogenerated by Thrift Compiler (2.
|
2
|
+
# Autogenerated by Thrift Compiler (2.5.4-upfluence)
|
3
3
|
#
|
4
4
|
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
5
|
#
|
6
6
|
|
7
7
|
require 'thrift'
|
8
|
-
require 'value_types'
|
8
|
+
require 'thrift/types/value/value_types'
|
9
9
|
|
10
10
|
module Thrift
|
11
11
|
module Types
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Autogenerated by Thrift Compiler (2.
|
2
|
+
# Autogenerated by Thrift Compiler (2.5.4-upfluence)
|
3
3
|
#
|
4
4
|
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
5
|
#
|
@@ -27,6 +27,12 @@ module Thrift
|
|
27
27
|
NAME = 'NullValue'.freeze
|
28
28
|
NAMESPACE = 'types.value'.freeze
|
29
29
|
|
30
|
+
LEGACY_ANNOTATIONS = {
|
31
|
+
}.freeze
|
32
|
+
|
33
|
+
STRUCTURED_ANNOTATIONS = [
|
34
|
+
].freeze
|
35
|
+
|
30
36
|
|
31
37
|
FIELDS = {
|
32
38
|
|
@@ -47,10 +53,22 @@ module Thrift
|
|
47
53
|
NAME = 'ListValue'.freeze
|
48
54
|
NAMESPACE = 'types.value'.freeze
|
49
55
|
|
56
|
+
LEGACY_ANNOTATIONS = {
|
57
|
+
}.freeze
|
58
|
+
|
59
|
+
STRUCTURED_ANNOTATIONS = [
|
60
|
+
].freeze
|
61
|
+
|
50
62
|
THRIFT_FIELD_INDEX_VALUES = 1
|
51
63
|
|
64
|
+
THRIFT_FIELD_VALUES_LEGACY_ANNOTATIONS = {
|
65
|
+
}.freeze
|
66
|
+
|
67
|
+
THRIFT_FIELD_VALUES_STRUCTURED_ANNOTATIONS = [
|
68
|
+
].freeze
|
69
|
+
|
52
70
|
FIELDS = {
|
53
|
-
THRIFT_FIELD_INDEX_VALUES => {type: ::Thrift::Types::LIST, name: 'values', element: {type: ::Thrift::Types::STRUCT, class: ::Thrift::Types::Value::Value}}
|
71
|
+
THRIFT_FIELD_INDEX_VALUES => {type: ::Thrift::Types::LIST, name: 'values', element: {type: ::Thrift::Types::STRUCT, class: ::Thrift::Types::Value::Value}, legacy_annotations: THRIFT_FIELD_VALUES_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_VALUES_STRUCTURED_ANNOTATIONS}
|
54
72
|
}
|
55
73
|
|
56
74
|
def struct_fields; FIELDS; end
|
@@ -69,12 +87,30 @@ module Thrift
|
|
69
87
|
NAME = 'MapEntry'.freeze
|
70
88
|
NAMESPACE = 'types.value'.freeze
|
71
89
|
|
90
|
+
LEGACY_ANNOTATIONS = {
|
91
|
+
}.freeze
|
92
|
+
|
93
|
+
STRUCTURED_ANNOTATIONS = [
|
94
|
+
].freeze
|
95
|
+
|
72
96
|
THRIFT_FIELD_INDEX_KEY = 1
|
73
97
|
THRIFT_FIELD_INDEX_VALUE = 2
|
74
98
|
|
99
|
+
THRIFT_FIELD_KEY_LEGACY_ANNOTATIONS = {
|
100
|
+
}.freeze
|
101
|
+
|
102
|
+
THRIFT_FIELD_KEY_STRUCTURED_ANNOTATIONS = [
|
103
|
+
].freeze
|
104
|
+
|
105
|
+
THRIFT_FIELD_VALUE_LEGACY_ANNOTATIONS = {
|
106
|
+
}.freeze
|
107
|
+
|
108
|
+
THRIFT_FIELD_VALUE_STRUCTURED_ANNOTATIONS = [
|
109
|
+
].freeze
|
110
|
+
|
75
111
|
FIELDS = {
|
76
|
-
THRIFT_FIELD_INDEX_KEY => {type: ::Thrift::Types::STRUCT, name: 'key', class: ::Thrift::Types::Value::Value},
|
77
|
-
THRIFT_FIELD_INDEX_VALUE => {type: ::Thrift::Types::STRUCT, name: 'value', class: ::Thrift::Types::Value::Value}
|
112
|
+
THRIFT_FIELD_INDEX_KEY => {type: ::Thrift::Types::STRUCT, name: 'key', class: ::Thrift::Types::Value::Value, legacy_annotations: THRIFT_FIELD_KEY_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_KEY_STRUCTURED_ANNOTATIONS},
|
113
|
+
THRIFT_FIELD_INDEX_VALUE => {type: ::Thrift::Types::STRUCT, name: 'value', class: ::Thrift::Types::Value::Value, legacy_annotations: THRIFT_FIELD_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_VALUE_STRUCTURED_ANNOTATIONS}
|
78
114
|
}
|
79
115
|
|
80
116
|
def struct_fields; FIELDS; end
|
@@ -94,10 +130,22 @@ module Thrift
|
|
94
130
|
NAME = 'MapValue'.freeze
|
95
131
|
NAMESPACE = 'types.value'.freeze
|
96
132
|
|
133
|
+
LEGACY_ANNOTATIONS = {
|
134
|
+
}.freeze
|
135
|
+
|
136
|
+
STRUCTURED_ANNOTATIONS = [
|
137
|
+
].freeze
|
138
|
+
|
97
139
|
THRIFT_FIELD_INDEX_ENTRIES = 1
|
98
140
|
|
141
|
+
THRIFT_FIELD_ENTRIES_LEGACY_ANNOTATIONS = {
|
142
|
+
}.freeze
|
143
|
+
|
144
|
+
THRIFT_FIELD_ENTRIES_STRUCTURED_ANNOTATIONS = [
|
145
|
+
].freeze
|
146
|
+
|
99
147
|
FIELDS = {
|
100
|
-
THRIFT_FIELD_INDEX_ENTRIES => {type: ::Thrift::Types::LIST, name: 'entries', element: {type: ::Thrift::Types::STRUCT, class: ::Thrift::Types::Value::MapEntry}}
|
148
|
+
THRIFT_FIELD_INDEX_ENTRIES => {type: ::Thrift::Types::LIST, name: 'entries', element: {type: ::Thrift::Types::STRUCT, class: ::Thrift::Types::Value::MapEntry}, legacy_annotations: THRIFT_FIELD_ENTRIES_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_ENTRIES_STRUCTURED_ANNOTATIONS}
|
101
149
|
}
|
102
150
|
|
103
151
|
def struct_fields; FIELDS; end
|
@@ -116,10 +164,22 @@ module Thrift
|
|
116
164
|
NAME = 'StructValue'.freeze
|
117
165
|
NAMESPACE = 'types.value'.freeze
|
118
166
|
|
167
|
+
LEGACY_ANNOTATIONS = {
|
168
|
+
}.freeze
|
169
|
+
|
170
|
+
STRUCTURED_ANNOTATIONS = [
|
171
|
+
].freeze
|
172
|
+
|
119
173
|
THRIFT_FIELD_INDEX_FIELDS = 1
|
120
174
|
|
175
|
+
THRIFT_FIELD_FIELDS_LEGACY_ANNOTATIONS = {
|
176
|
+
}.freeze
|
177
|
+
|
178
|
+
THRIFT_FIELD_FIELDS_STRUCTURED_ANNOTATIONS = [
|
179
|
+
].freeze
|
180
|
+
|
121
181
|
FIELDS = {
|
122
|
-
THRIFT_FIELD_INDEX_FIELDS => {type: ::Thrift::Types::MAP, name: 'fields', key: {type: ::Thrift::Types::STRING}, value: {type: ::Thrift::Types::STRUCT, class: ::Thrift::Types::Value::Value}}
|
182
|
+
THRIFT_FIELD_INDEX_FIELDS => {type: ::Thrift::Types::MAP, name: 'fields', key: {type: ::Thrift::Types::STRING}, value: {type: ::Thrift::Types::STRUCT, class: ::Thrift::Types::Value::Value}, legacy_annotations: THRIFT_FIELD_FIELDS_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_FIELDS_STRUCTURED_ANNOTATIONS}
|
123
183
|
}
|
124
184
|
|
125
185
|
def struct_fields; FIELDS; end
|
@@ -138,6 +198,12 @@ module Thrift
|
|
138
198
|
NAME = 'Value'.freeze
|
139
199
|
NAMESPACE = 'types.value'.freeze
|
140
200
|
|
201
|
+
LEGACY_ANNOTATIONS = {
|
202
|
+
}.freeze
|
203
|
+
|
204
|
+
STRUCTURED_ANNOTATIONS = [
|
205
|
+
].freeze
|
206
|
+
|
141
207
|
class << self
|
142
208
|
def null_value(val)
|
143
209
|
Value.new(:null_value, val)
|
@@ -186,16 +252,70 @@ module Thrift
|
|
186
252
|
THRIFT_FIELD_INDEX_MAP_VALUE = 8
|
187
253
|
THRIFT_FIELD_INDEX_STRUCT_VALUE = 9
|
188
254
|
|
255
|
+
THRIFT_FIELD_NULL_VALUE_LEGACY_ANNOTATIONS = {
|
256
|
+
}.freeze
|
257
|
+
|
258
|
+
THRIFT_FIELD_NULL_VALUE_STRUCTURED_ANNOTATIONS = [
|
259
|
+
].freeze
|
260
|
+
|
261
|
+
THRIFT_FIELD_STRING_VALUE_LEGACY_ANNOTATIONS = {
|
262
|
+
}.freeze
|
263
|
+
|
264
|
+
THRIFT_FIELD_STRING_VALUE_STRUCTURED_ANNOTATIONS = [
|
265
|
+
].freeze
|
266
|
+
|
267
|
+
THRIFT_FIELD_BINARY_VALUE_LEGACY_ANNOTATIONS = {
|
268
|
+
}.freeze
|
269
|
+
|
270
|
+
THRIFT_FIELD_BINARY_VALUE_STRUCTURED_ANNOTATIONS = [
|
271
|
+
].freeze
|
272
|
+
|
273
|
+
THRIFT_FIELD_INTEGER_VALUE_LEGACY_ANNOTATIONS = {
|
274
|
+
}.freeze
|
275
|
+
|
276
|
+
THRIFT_FIELD_INTEGER_VALUE_STRUCTURED_ANNOTATIONS = [
|
277
|
+
].freeze
|
278
|
+
|
279
|
+
THRIFT_FIELD_DOUBLE_VALUE_LEGACY_ANNOTATIONS = {
|
280
|
+
}.freeze
|
281
|
+
|
282
|
+
THRIFT_FIELD_DOUBLE_VALUE_STRUCTURED_ANNOTATIONS = [
|
283
|
+
].freeze
|
284
|
+
|
285
|
+
THRIFT_FIELD_BOOL_VALUE_LEGACY_ANNOTATIONS = {
|
286
|
+
}.freeze
|
287
|
+
|
288
|
+
THRIFT_FIELD_BOOL_VALUE_STRUCTURED_ANNOTATIONS = [
|
289
|
+
].freeze
|
290
|
+
|
291
|
+
THRIFT_FIELD_LIST_VALUE_LEGACY_ANNOTATIONS = {
|
292
|
+
}.freeze
|
293
|
+
|
294
|
+
THRIFT_FIELD_LIST_VALUE_STRUCTURED_ANNOTATIONS = [
|
295
|
+
].freeze
|
296
|
+
|
297
|
+
THRIFT_FIELD_MAP_VALUE_LEGACY_ANNOTATIONS = {
|
298
|
+
}.freeze
|
299
|
+
|
300
|
+
THRIFT_FIELD_MAP_VALUE_STRUCTURED_ANNOTATIONS = [
|
301
|
+
].freeze
|
302
|
+
|
303
|
+
THRIFT_FIELD_STRUCT_VALUE_LEGACY_ANNOTATIONS = {
|
304
|
+
}.freeze
|
305
|
+
|
306
|
+
THRIFT_FIELD_STRUCT_VALUE_STRUCTURED_ANNOTATIONS = [
|
307
|
+
].freeze
|
308
|
+
|
189
309
|
FIELDS = {
|
190
|
-
THRIFT_FIELD_INDEX_NULL_VALUE => {type: ::Thrift::Types::STRUCT, name: 'null_value', class: ::Thrift::Types::Value::NullValue},
|
191
|
-
THRIFT_FIELD_INDEX_STRING_VALUE => {type: ::Thrift::Types::STRING, name: 'string_value'},
|
192
|
-
THRIFT_FIELD_INDEX_BINARY_VALUE => {type: ::Thrift::Types::STRING, name: 'binary_value', binary: true},
|
193
|
-
THRIFT_FIELD_INDEX_INTEGER_VALUE => {type: ::Thrift::Types::I64, name: 'integer_value'},
|
194
|
-
THRIFT_FIELD_INDEX_DOUBLE_VALUE => {type: ::Thrift::Types::DOUBLE, name: 'double_value'},
|
195
|
-
THRIFT_FIELD_INDEX_BOOL_VALUE => {type: ::Thrift::Types::BOOL, name: 'bool_value'},
|
196
|
-
THRIFT_FIELD_INDEX_LIST_VALUE => {type: ::Thrift::Types::STRUCT, name: 'list_value', class: ::Thrift::Types::Value::ListValue},
|
197
|
-
THRIFT_FIELD_INDEX_MAP_VALUE => {type: ::Thrift::Types::STRUCT, name: 'map_value', class: ::Thrift::Types::Value::MapValue},
|
198
|
-
THRIFT_FIELD_INDEX_STRUCT_VALUE => {type: ::Thrift::Types::STRUCT, name: 'struct_value', class: ::Thrift::Types::Value::StructValue}
|
310
|
+
THRIFT_FIELD_INDEX_NULL_VALUE => {type: ::Thrift::Types::STRUCT, name: 'null_value', class: ::Thrift::Types::Value::NullValue, legacy_annotations: THRIFT_FIELD_NULL_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_NULL_VALUE_STRUCTURED_ANNOTATIONS},
|
311
|
+
THRIFT_FIELD_INDEX_STRING_VALUE => {type: ::Thrift::Types::STRING, name: 'string_value', legacy_annotations: THRIFT_FIELD_STRING_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_STRING_VALUE_STRUCTURED_ANNOTATIONS},
|
312
|
+
THRIFT_FIELD_INDEX_BINARY_VALUE => {type: ::Thrift::Types::STRING, name: 'binary_value', binary: true, legacy_annotations: THRIFT_FIELD_BINARY_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_BINARY_VALUE_STRUCTURED_ANNOTATIONS},
|
313
|
+
THRIFT_FIELD_INDEX_INTEGER_VALUE => {type: ::Thrift::Types::I64, name: 'integer_value', legacy_annotations: THRIFT_FIELD_INTEGER_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_INTEGER_VALUE_STRUCTURED_ANNOTATIONS},
|
314
|
+
THRIFT_FIELD_INDEX_DOUBLE_VALUE => {type: ::Thrift::Types::DOUBLE, name: 'double_value', legacy_annotations: THRIFT_FIELD_DOUBLE_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_DOUBLE_VALUE_STRUCTURED_ANNOTATIONS},
|
315
|
+
THRIFT_FIELD_INDEX_BOOL_VALUE => {type: ::Thrift::Types::BOOL, name: 'bool_value', legacy_annotations: THRIFT_FIELD_BOOL_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_BOOL_VALUE_STRUCTURED_ANNOTATIONS},
|
316
|
+
THRIFT_FIELD_INDEX_LIST_VALUE => {type: ::Thrift::Types::STRUCT, name: 'list_value', class: ::Thrift::Types::Value::ListValue, legacy_annotations: THRIFT_FIELD_LIST_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_LIST_VALUE_STRUCTURED_ANNOTATIONS},
|
317
|
+
THRIFT_FIELD_INDEX_MAP_VALUE => {type: ::Thrift::Types::STRUCT, name: 'map_value', class: ::Thrift::Types::Value::MapValue, legacy_annotations: THRIFT_FIELD_MAP_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_MAP_VALUE_STRUCTURED_ANNOTATIONS},
|
318
|
+
THRIFT_FIELD_INDEX_STRUCT_VALUE => {type: ::Thrift::Types::STRUCT, name: 'struct_value', class: ::Thrift::Types::Value::StructValue, legacy_annotations: THRIFT_FIELD_STRUCT_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_STRUCT_VALUE_STRUCTURED_ANNOTATIONS}
|
199
319
|
}
|
200
320
|
|
201
321
|
def struct_fields; FIELDS; end
|
data/lib/thrift.rb
CHANGED
@@ -68,3 +68,8 @@ require 'thrift/server/threaded_server'
|
|
68
68
|
require 'thrift/server/thread_pool_server'
|
69
69
|
|
70
70
|
require 'thrift/thrift_native'
|
71
|
+
|
72
|
+
require 'thrift/types/known/any/any'
|
73
|
+
require 'thrift/types/known/timestamp/timestamp'
|
74
|
+
require 'thrift/types/known/duration/duration'
|
75
|
+
require 'thrift/types/annotation/naming/naming'
|
data/spec/json_protocol_spec.rb
CHANGED
@@ -21,6 +21,23 @@
|
|
21
21
|
require 'spec_helper'
|
22
22
|
|
23
23
|
describe 'JsonProtocol' do
|
24
|
+
describe Thrift::SimpleJsonProtocol do
|
25
|
+
before(:each) do
|
26
|
+
@trans = Thrift::MemoryBufferTransport.new
|
27
|
+
@prot = Thrift::SimpleJsonProtocol.new(@trans)
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'should pretty print object' do
|
31
|
+
SpecNamespace::Hello.new.write(@prot)
|
32
|
+
|
33
|
+
@trans.read(@trans.available).should == '{"greeting":"hello world"}'
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'shound not be able to read message' do
|
37
|
+
@trans.write('{"greeting":"hello world"}')
|
38
|
+
expect {@prot.read_message_begin}.to raise_error(Thrift::ProtocolException)
|
39
|
+
end
|
40
|
+
end
|
24
41
|
|
25
42
|
describe Thrift::JsonProtocol do
|
26
43
|
before(:each) do
|
data/spec/spec_helper.rb
CHANGED
@@ -44,21 +44,21 @@ RSpec.configure do |configuration|
|
|
44
44
|
Thrift.type_checking = true
|
45
45
|
end
|
46
46
|
end
|
47
|
-
|
48
|
-
$:.unshift File.join(File.dirname(__FILE__), *%w[.. test debug_proto gen-rb])
|
49
|
-
require 'srv'
|
50
|
-
require 'debug_proto_test_constants'
|
51
|
-
|
52
|
-
$:.unshift File.join(File.dirname(__FILE__), *%w[gen-rb])
|
53
|
-
require 'thrift_spec_types'
|
54
|
-
require 'nonblocking_service'
|
55
|
-
|
56
|
-
module Fixtures
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
end
|
62
|
-
|
63
|
-
$:.unshift File.join(File.dirname(__FILE__), *%w[gen-rb/flat])
|
47
|
+
#
|
48
|
+
# $:.unshift File.join(File.dirname(__FILE__), *%w[.. test debug_proto gen-rb])
|
49
|
+
# require 'srv'
|
50
|
+
# require 'debug_proto_test_constants'
|
51
|
+
#
|
52
|
+
# $:.unshift File.join(File.dirname(__FILE__), *%w[gen-rb])
|
53
|
+
# require 'thrift_spec_types'
|
54
|
+
# require 'nonblocking_service'
|
55
|
+
#
|
56
|
+
# module Fixtures
|
57
|
+
# COMPACT_PROTOCOL_TEST_STRUCT = COMPACT_TEST.dup
|
58
|
+
# COMPACT_PROTOCOL_TEST_STRUCT.a_binary = [0,1,2,3,4,5,6,7,8].pack('c*')
|
59
|
+
# COMPACT_PROTOCOL_TEST_STRUCT.set_byte_map = nil
|
60
|
+
# COMPACT_PROTOCOL_TEST_STRUCT.map_byte_map = nil
|
61
|
+
# end
|
62
|
+
#
|
63
|
+
# $:.unshift File.join(File.dirname(__FILE__), *%w[gen-rb/flat])
|
64
64
|
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: upfluence-thrift
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thrift Developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: thin
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: bundler
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,18 +161,23 @@ extra_rdoc_files:
|
|
161
161
|
- lib/thrift/transport/socket.rb
|
162
162
|
- lib/thrift/transport/unix_server_socket.rb
|
163
163
|
- lib/thrift/transport/unix_socket.rb
|
164
|
-
- lib/thrift/types/
|
165
|
-
- lib/thrift/types/
|
166
|
-
- lib/thrift/types/
|
167
|
-
- lib/thrift/types/
|
168
|
-
- lib/thrift/types/
|
169
|
-
- lib/thrift/types/known/
|
170
|
-
- lib/thrift/types/known/
|
171
|
-
- lib/thrift/types/known/
|
172
|
-
- lib/thrift/types/known/
|
173
|
-
- lib/thrift/types/
|
174
|
-
- lib/thrift/types/
|
175
|
-
- lib/thrift/types/
|
164
|
+
- lib/thrift/types/annotation/deprecation/deprecation_constants.rb
|
165
|
+
- lib/thrift/types/annotation/deprecation/deprecation_types.rb
|
166
|
+
- lib/thrift/types/annotation/naming/naming.rb
|
167
|
+
- lib/thrift/types/annotation/naming/naming_constants.rb
|
168
|
+
- lib/thrift/types/annotation/naming/naming_types.rb
|
169
|
+
- lib/thrift/types/known/any/any.rb
|
170
|
+
- lib/thrift/types/known/any/any_constants.rb
|
171
|
+
- lib/thrift/types/known/any/any_types.rb
|
172
|
+
- lib/thrift/types/known/duration/duration.rb
|
173
|
+
- lib/thrift/types/known/duration/duration_constants.rb
|
174
|
+
- lib/thrift/types/known/duration/duration_types.rb
|
175
|
+
- lib/thrift/types/known/timestamp/timestamp.rb
|
176
|
+
- lib/thrift/types/known/timestamp/timestamp_constants.rb
|
177
|
+
- lib/thrift/types/known/timestamp/timestamp_types.rb
|
178
|
+
- lib/thrift/types/value/value.rb
|
179
|
+
- lib/thrift/types/value/value_constants.rb
|
180
|
+
- lib/thrift/types/value/value_types.rb
|
176
181
|
- lib/thrift/types.rb
|
177
182
|
- lib/thrift/union.rb
|
178
183
|
- lib/thrift.rb
|
@@ -244,18 +249,23 @@ files:
|
|
244
249
|
- lib/thrift/transport/unix_server_socket.rb
|
245
250
|
- lib/thrift/transport/unix_socket.rb
|
246
251
|
- lib/thrift/types.rb
|
247
|
-
- lib/thrift/types/
|
248
|
-
- lib/thrift/types/
|
249
|
-
- lib/thrift/types/
|
250
|
-
- lib/thrift/types/
|
251
|
-
- lib/thrift/types/
|
252
|
-
- lib/thrift/types/known/
|
253
|
-
- lib/thrift/types/known/
|
254
|
-
- lib/thrift/types/known/
|
255
|
-
- lib/thrift/types/known/
|
256
|
-
- lib/thrift/types/
|
257
|
-
- lib/thrift/types/
|
258
|
-
- lib/thrift/types/
|
252
|
+
- lib/thrift/types/annotation/deprecation/deprecation_constants.rb
|
253
|
+
- lib/thrift/types/annotation/deprecation/deprecation_types.rb
|
254
|
+
- lib/thrift/types/annotation/naming/naming.rb
|
255
|
+
- lib/thrift/types/annotation/naming/naming_constants.rb
|
256
|
+
- lib/thrift/types/annotation/naming/naming_types.rb
|
257
|
+
- lib/thrift/types/known/any/any.rb
|
258
|
+
- lib/thrift/types/known/any/any_constants.rb
|
259
|
+
- lib/thrift/types/known/any/any_types.rb
|
260
|
+
- lib/thrift/types/known/duration/duration.rb
|
261
|
+
- lib/thrift/types/known/duration/duration_constants.rb
|
262
|
+
- lib/thrift/types/known/duration/duration_types.rb
|
263
|
+
- lib/thrift/types/known/timestamp/timestamp.rb
|
264
|
+
- lib/thrift/types/known/timestamp/timestamp_constants.rb
|
265
|
+
- lib/thrift/types/known/timestamp/timestamp_types.rb
|
266
|
+
- lib/thrift/types/value/value.rb
|
267
|
+
- lib/thrift/types/value/value_constants.rb
|
268
|
+
- lib/thrift/types/value/value_types.rb
|
259
269
|
- lib/thrift/union.rb
|
260
270
|
- spec/BaseService.thrift
|
261
271
|
- spec/ExtendedService.thrift
|
@@ -320,7 +330,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
320
330
|
- !ruby/object:Gem::Version
|
321
331
|
version: '0'
|
322
332
|
requirements: []
|
323
|
-
rubygems_version: 3.
|
333
|
+
rubygems_version: 3.5.3
|
324
334
|
signing_key:
|
325
335
|
specification_version: 4
|
326
336
|
summary: Ruby bindings for Apache Thrift
|