Module: ElasticGraph::ProtoIngestion::SchemaDefinition::APIExtension

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

Overview

Module designed to be extended onto an SchemaDefinition::API instance to enable protobuf schema artifact generation.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(api) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Wires up the protobuf extensions when this module is extended onto an API instance.

Parameters:



29
30
31
32
# File 'elasticgraph-proto_ingestion/lib/elastic_graph/proto_ingestion/schema_definition/api_extension.rb', line 29

def self.extended(api)
  api.state.extend(StateExtension)
  api.factory.extend(FactoryExtension)
end

Instance Method Details

#proto_schema_artifacts(package_name:) ⇒ void

This method returns an undefined value.

Configures protobuf artifact generation behavior.

Examples:

Set the proto package name

ElasticGraph.define_schema do |schema|
  schema.proto_schema_artifacts package_name: "myapp.events.v1"
end

Parameters:

  • package_name (String)

    proto package name to emit



43
44
45
46
# File 'elasticgraph-proto_ingestion/lib/elastic_graph/proto_ingestion/schema_definition/api_extension.rb', line 43

def proto_schema_artifacts(package_name:)
  proto_ingestion_state.package_name = Identifier.validate_package_name(package_name)
  nil
end