Name things slightly better

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben
2020-03-30 14:54:04 +02:00
parent cca578a460
commit 494227d95f
3 changed files with 17 additions and 18 deletions

16
plugin/traffic/grpc_lb.go Normal file
View File

@@ -0,0 +1,16 @@
package traffic
import (
"github.com/miekg/dns"
)
// See https://github.com/grpc/grpc/blob/master/doc/service_config.md for the fields in this proto.
// We encode it as json and return it in a TXT field.
var lbTXT = `grpc_config=[{"serviceConfig":{"loadBalancingConfig":[{"eds_experimental":{"LrsLoadReportingServerName":"","Cluster": "xds"}}]}}]`
func txt(z string) []dns.RR {
return []dns.RR{&dns.TXT{
Hdr: dns.RR_Header{Name: z, Rrtype: dns.TypeTXT, Class: dns.ClassINET, Ttl: 5},
Txt: []string{lbTXT},
}}
}