bec4df0679
This mimics xDS's discovery protocol where you must request a resource explicitly for the exporting side to send those events to you. As part of this I aligned the overall ResourceURL with the TypeURL that gets embedded into the encoded protobuf Any construct. The CheckServiceNodes is now wrapped in a better named "ExportedService" struct now.
17 lines
411 B
Go
17 lines
411 B
Go
package pbpeerstream
|
|
|
|
const (
|
|
apiTypePrefix = "type.googleapis.com/"
|
|
|
|
TypeURLExportedService = apiTypePrefix + "hashicorp.consul.internal.peerstream.ExportedService"
|
|
TypeURLPeeringTrustBundle = apiTypePrefix + "hashicorp.consul.internal.peering.PeeringTrustBundle"
|
|
)
|
|
|
|
func KnownTypeURL(s string) bool {
|
|
switch s {
|
|
case TypeURLExportedService, TypeURLPeeringTrustBundle:
|
|
return true
|
|
}
|
|
return false
|
|
}
|