Module: Async::GRPC::XDS::Endpoint

Extended by:
Endpoint
Included in:
Endpoint
Defined in:
lib/async/grpc/xds/endpoint.rb

Overview

Builds Envoy endpoint resources.

Constant Summary collapse

TYPE_URL =
"type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment"

Instance Method Summary collapse

Instance Method Details

#build(cluster_name, endpoints) ⇒ Object

Build an EDS cluster load assignment from normalized endpoint state.



23
24
25
26
27
28
29
30
31
32
# File 'lib/async/grpc/xds/endpoint.rb', line 23

def build(cluster_name, endpoints)
	Envoy::Config::Endpoint::V3::ClusterLoadAssignment.new(
		cluster_name: cluster_name.to_s,
		endpoints: [
			Envoy::Config::Endpoint::V3::LocalityLbEndpoints.new(
				lb_endpoints: endpoints.map{|endpoint| load_balancer_endpoint(endpoint)}
			)
		]
	)
end