mirror of
https://github.com/linka-cloud/grpc.git
synced 2025-06-22 09:12:28 +00:00
add client address option, fix noop resolver
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
package noop
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"google.golang.org/grpc/resolver"
|
||||
|
||||
"go.linka.cloud/grpc/registry"
|
||||
@ -42,17 +44,9 @@ func (n noop) ListServices(option ...registry.ListOption) ([]*registry.Service,
|
||||
}
|
||||
|
||||
func (n noop) Watch(option ...registry.WatchOption) (registry.Watcher, error) {
|
||||
return noopWatcher{}, nil
|
||||
return nil, errors.New("watch not supported")
|
||||
}
|
||||
|
||||
func (n noop) String() string {
|
||||
return "passthroug"
|
||||
}
|
||||
|
||||
type noopWatcher struct{}
|
||||
|
||||
func (n noopWatcher) Next() (*registry.Result, error) {
|
||||
return ®istry.Result{}, nil
|
||||
}
|
||||
|
||||
func (n noopWatcher) Stop() {}
|
||||
|
Reference in New Issue
Block a user