Remove DescSource
This commit is contained in:
parent
b5b9230450
commit
4985b1f15b
|
|
@ -673,7 +673,6 @@ func main() {
|
||||||
}
|
}
|
||||||
h := &grpcurl.DefaultEventHandler{
|
h := &grpcurl.DefaultEventHandler{
|
||||||
Out: os.Stdout,
|
Out: os.Stdout,
|
||||||
DescSource: descSource,
|
|
||||||
Formatter: formatter,
|
Formatter: formatter,
|
||||||
VerbosityLevel: verbosityLevel,
|
VerbosityLevel: verbosityLevel,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -409,9 +409,8 @@ func RequestParserAndFormatterFor(format Format, descSource DescriptorSource, em
|
||||||
// safe for use with InvokeRPC as long as NumResponses and Status are not read
|
// safe for use with InvokeRPC as long as NumResponses and Status are not read
|
||||||
// until the call to InvokeRPC completes.
|
// until the call to InvokeRPC completes.
|
||||||
type DefaultEventHandler struct {
|
type DefaultEventHandler struct {
|
||||||
Out io.Writer
|
Out io.Writer
|
||||||
DescSource DescriptorSource
|
Formatter Formatter
|
||||||
Formatter func(proto.Message) (string, error)
|
|
||||||
// 0 = default
|
// 0 = default
|
||||||
// 1 = verbose
|
// 1 = verbose
|
||||||
// 2 = very verbose
|
// 2 = very verbose
|
||||||
|
|
@ -439,7 +438,6 @@ func NewDefaultEventHandler(out io.Writer, descSource DescriptorSource, formatte
|
||||||
}
|
}
|
||||||
return &DefaultEventHandler{
|
return &DefaultEventHandler{
|
||||||
Out: out,
|
Out: out,
|
||||||
DescSource: descSource,
|
|
||||||
Formatter: formatter,
|
Formatter: formatter,
|
||||||
VerbosityLevel: verbosityLevel,
|
VerbosityLevel: verbosityLevel,
|
||||||
}
|
}
|
||||||
|
|
@ -449,7 +447,7 @@ var _ InvocationEventHandler = (*DefaultEventHandler)(nil)
|
||||||
|
|
||||||
func (h *DefaultEventHandler) OnResolveMethod(md *desc.MethodDescriptor) {
|
func (h *DefaultEventHandler) OnResolveMethod(md *desc.MethodDescriptor) {
|
||||||
if h.VerbosityLevel > 0 {
|
if h.VerbosityLevel > 0 {
|
||||||
txt, err := GetDescriptorText(md, h.DescSource)
|
txt, err := GetDescriptorText(md, nil)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
fmt.Fprintf(h.Out, "\nResolved method descriptor:\n%s\n", txt)
|
fmt.Fprintf(h.Out, "\nResolved method descriptor:\n%s\n", txt)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,6 @@ func TestHandler(t *testing.T) {
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
h := &DefaultEventHandler{
|
h := &DefaultEventHandler{
|
||||||
Out: &buf,
|
Out: &buf,
|
||||||
DescSource: source,
|
|
||||||
Formatter: formatter,
|
Formatter: formatter,
|
||||||
VerbosityLevel: verbosityLevel,
|
VerbosityLevel: verbosityLevel,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue