Module: ElasticGraph::ProtoIngestion::SchemaDefinition::ResultsExtension

Defined in:
elasticgraph-proto_ingestion/lib/elastic_graph/proto_ingestion/schema_definition/results_extension.rb

Overview

Extension module for SchemaDefinition::Results that adds proto schema generation support.

Instance Method Summary collapse

Instance Method Details

#proto_field_number_mappings ⇒ Hash<String, Object>

Returns proto field-number mappings suitable for artifact storage.

Returns:

  • (Hash<String, Object>)


27
28
29
30
31
# File 'elasticgraph-proto_ingestion/lib/elastic_graph/proto_ingestion/schema_definition/results_extension.rb', line 27

def proto_field_number_mappings
  # Numbers get assigned as `schema.proto` renders, so we must render before reading them.
  proto_schema
  protobuf_schema_generator.field_number_mappings_for_artifact
end

#proto_schema ⇒ String

Returns the generated proto schema.

Returns:

  • (String) —

    complete proto3 schema file contents



20
21
22
# File 'elasticgraph-proto_ingestion/lib/elastic_graph/proto_ingestion/schema_definition/results_extension.rb', line 20

def proto_schema
  @proto_schema ||= protobuf_schema_generator.to_proto
end