/
intf.go
40 lines (32 loc) · 1014 Bytes
/
intf.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package grpcget
import (
"context"
"github.com/golang/protobuf/proto"
"github.com/jhump/protoreflect/desc"
"github.com/jhump/protoreflect/dynamic"
"google.golang.org/grpc"
)
// Interface to supply a connection to GrpcGet
type ConnectionSupplier interface {
GetConnection(ctx context.Context) (*grpc.ClientConn, error)
}
// Interface that outputs a service list
type ServiceListOutput interface {
OutputServiceList(services []string) error
}
// Interface that outputs a single service and its methods
type ServiceOutput interface {
OutputService(service *desc.ServiceDescriptor) error
}
// Interface that outputs descrption of a symbol
type DescribeOutput interface {
OutputDescribe(descriptor desc.Descriptor) error
}
// Setter for an invoke parameters
type InvokeParamSetter interface {
SetInvokeParam(dmh *DynMsgHelper, req *dynamic.Message) error
}
// Interface that outputs the response of an invoke
type InvokeOutput interface {
OutputInvoke(dmh *DynMsgHelper, value proto.Message) error
}