Class: FinagleThrift::BinaryAnnotation

Inherits:
Object
  • Object
show all
Includes:
Thrift::Struct, Thrift::Struct_Union
Defined in:
lib/finagle-thrift/thrift/tracing_types.rb

Constant Summary collapse

KEY =
1
VALUE =
2
ANNOTATION_TYPE =
3
HOST =
4
FIELDS =
{
  KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
  VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :binary => true},
  ANNOTATION_TYPE => {:type => ::Thrift::Types::I32, :name => 'annotation_type', :enum_class => FinagleThrift::AnnotationType},
  HOST => {:type => ::Thrift::Types::STRUCT, :name => 'host', :class => FinagleThrift::Endpoint, :optional => true}
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



77
# File 'lib/finagle-thrift/thrift/tracing_types.rb', line 77

def struct_fields; FIELDS; end

#validateObject



79
80
81
82
83
# File 'lib/finagle-thrift/thrift/tracing_types.rb', line 79

def validate
  unless @annotation_type.nil? || FinagleThrift::AnnotationType::VALID_VALUES.include?(@annotation_type)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field annotation_type!')
  end
end