You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
552 B
Go
36 lines
552 B
Go
4 years ago
|
package resolver
|
||
|
|
||
4 years ago
|
import (
|
||
|
"fmt"
|
||
|
|
||
|
"google.golang.org/grpc/resolver"
|
||
|
)
|
||
4 years ago
|
|
||
4 years ago
|
const (
|
||
4 years ago
|
DirectScheme = "direct"
|
||
|
DiscovScheme = "discov"
|
||
|
EndpointSepChar = ','
|
||
|
subsetSize = 32
|
||
4 years ago
|
)
|
||
|
|
||
4 years ago
|
var (
|
||
4 years ago
|
EndpointSep = fmt.Sprintf("%c", EndpointSepChar)
|
||
|
dirBuilder directBuilder
|
||
|
disBuilder discovBuilder
|
||
4 years ago
|
)
|
||
4 years ago
|
|
||
4 years ago
|
func RegisterResolver() {
|
||
|
resolver.Register(&dirBuilder)
|
||
|
resolver.Register(&disBuilder)
|
||
4 years ago
|
}
|
||
|
|
||
4 years ago
|
type nopResolver struct {
|
||
4 years ago
|
cc resolver.ClientConn
|
||
4 years ago
|
}
|
||
|
|
||
4 years ago
|
func (r *nopResolver) Close() {
|
||
4 years ago
|
}
|
||
|
|
||
4 years ago
|
func (r *nopResolver) ResolveNow(options resolver.ResolveNowOptions) {
|
||
4 years ago
|
}
|