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_mappingsHash<String, Object>

Returns proto field-number mappings suitable for artifact storage.

Returns:

  • (Hash<String, Object>)


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

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_schemaString

Returns the generated proto schema.

Returns:

  • (String)

    complete proto3 schema file contents



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

def proto_schema
  @proto_schema ||= protobuf_schema_generator.to_proto
end