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