resolver.go 552 B

1234567891011121314151617181920212223242526272829303132333435
  1. package resolver
  2. import (
  3. "fmt"
  4. "google.golang.org/grpc/resolver"
  5. )
  6. const (
  7. DirectScheme = "direct"
  8. DiscovScheme = "discov"
  9. EndpointSepChar = ','
  10. subsetSize = 32
  11. )
  12. var (
  13. EndpointSep = fmt.Sprintf("%c", EndpointSepChar)
  14. dirBuilder directBuilder
  15. disBuilder discovBuilder
  16. )
  17. func RegisterResolver() {
  18. resolver.Register(&dirBuilder)
  19. resolver.Register(&disBuilder)
  20. }
  21. type nopResolver struct {
  22. cc resolver.ClientConn
  23. }
  24. func (r *nopResolver) Close() {
  25. }
  26. func (r *nopResolver) ResolveNow(options resolver.ResolveNowOptions) {
  27. }