mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-25 02:08:44 +08:00
31 lines
475 B
Go
31 lines
475 B
Go
package resolver
|
|
|
|
import "google.golang.org/grpc/resolver"
|
|
|
|
const (
|
|
DirectScheme = "direct"
|
|
DiscovScheme = "discov"
|
|
EndpointSep = ","
|
|
subsetSize = 32
|
|
)
|
|
|
|
var (
|
|
dirBuilder directBuilder
|
|
disBuilder discovBuilder
|
|
)
|
|
|
|
func RegisterResolver() {
|
|
resolver.Register(&dirBuilder)
|
|
resolver.Register(&disBuilder)
|
|
}
|
|
|
|
type nopResolver struct {
|
|
cc resolver.ClientConn
|
|
}
|
|
|
|
func (r *nopResolver) Close() {
|
|
}
|
|
|
|
func (r *nopResolver) ResolveNow(options resolver.ResolveNowOptions) {
|
|
}
|