Documentation ¶
Index ¶
- func AllMethodsForServer(svr *grpc.Server) ([]*desc.MethodDescriptor, error)
- func AllMethodsForServices(descs []*desc.ServiceDescriptor) []*desc.MethodDescriptor
- func AllMethodsViaInProcess(svr reflection.GRPCServer) ([]*desc.MethodDescriptor, error)
- func EnumerateResourceBlocks(server *pgrpc.Server, isLangService bool) ([]*gen.Node, error)
- func FileContentsFromMap(files map[string]string) protoparse.FileAccessor
- func GetGRPCTypeInfo(host string) ([]*gen.GRPCService, error)
- func ParseProto(file string) ([]*desc.FileDescriptor, error)
- func ParseProtoDir(dir, protofile string) ([]*desc.FileDescriptor, error)
- func ResolveTypeLookup(msgDesc protoreflect.MessageDescriptor, ...) (map[string]protoreflect.MessageDescriptor, ...)
- func SerializeType(m protoreflect.ProtoMessage) (*desc.MessageDescriptor, error)
- type MethodDescriptor
- type MethodDescriptorProto
- type RpcResult
- type SerializedTypeResolver
- type TypeResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllMethodsForServer ¶
func AllMethodsForServer(svr *grpc.Server) ([]*desc.MethodDescriptor, error)
AllMethodsForServer returns a slice that contains the method descriptors for all methods exposed by the given gRPC server.
func AllMethodsForServices ¶
func AllMethodsForServices(descs []*desc.ServiceDescriptor) []*desc.MethodDescriptor
AllMethodsForServices returns a slice that contains the method descriptors for all methods in the given services.
func AllMethodsViaInProcess ¶
func AllMethodsViaInProcess(svr reflection.GRPCServer) ([]*desc.MethodDescriptor, error)
AllMethodsViaInProcess returns a slice that contains the method descriptors for all methods exposed by the given server. This automatically skips the reflection service, since it is assumed this is not a desired inclusion.
func EnumerateResourceBlocks ¶
func FileContentsFromMap ¶
func FileContentsFromMap(files map[string]string) protoparse.FileAccessor
func GetGRPCTypeInfo ¶
func GetGRPCTypeInfo(host string) ([]*gen.GRPCService, error)
func ParseProto ¶
func ParseProto(file string) ([]*desc.FileDescriptor, error)
func ParseProtoDir ¶
func ParseProtoDir(dir, protofile string) ([]*desc.FileDescriptor, error)
func ResolveTypeLookup ¶
func ResolveTypeLookup( msgDesc protoreflect.MessageDescriptor, descLookup map[string]protoreflect.MessageDescriptor, enumLookup map[string]protoreflect.EnumDescriptor, ) (map[string]protoreflect.MessageDescriptor, map[string]protoreflect.EnumDescriptor)
TODO breadchris placeholder until the above is implemented
func SerializeType ¶
func SerializeType(m protoreflect.ProtoMessage) (*desc.MessageDescriptor, error)
Types ¶
type MethodDescriptor ¶
type MethodDescriptor struct { MethodDesc protoreflect.MethodDescriptor DescLookup map[string]protoreflect.MessageDescriptor EnumLookup map[string]protoreflect.EnumDescriptor //FileDesc protoreflect.FileDescriptor FileBuilder *builder.FileBuilder }
func NewMethodDescriptor ¶
func NewMethodDescriptor(md protoreflect.MethodDescriptor) (*MethodDescriptor, error)
TODO breadchris make this more generic to allow different type of descriptors such as MessageDescriptor
func (*MethodDescriptor) Print ¶
func (m *MethodDescriptor) Print() (string, error)
func (*MethodDescriptor) Proto ¶
func (m *MethodDescriptor) Proto() (*gen.GRPCTypeInfo, error)
Proto returns a proto representation of the MethodDescriptor
type MethodDescriptorProto ¶
type MethodDescriptorProto struct { DescLookup map[string]*descriptorpb.DescriptorProto EnumLookup map[string]*descriptorpb.EnumDescriptorProto }
type RpcResult ¶
type RpcResult struct { DescSource grpcurl.DescriptorSource Headers []rpcMetadata `json:"headers"` Error *rpcError `json:"error"` Responses []rpcResponseElement `json:"responses"` Requests *rpcRequestStats `json:"requests"` Trailers []rpcMetadata `json:"trailers"` }
func (*RpcResult) OnReceiveHeaders ¶
func (*RpcResult) OnReceiveResponse ¶
func (*RpcResult) OnReceiveTrailers ¶
func (*RpcResult) OnResolveMethod ¶
func (*RpcResult) OnResolveMethod(*desc.MethodDescriptor)
func (*RpcResult) OnSendHeaders ¶
type SerializedTypeResolver ¶
type SerializedTypeResolver struct { DescLookup map[string]*descriptorpb.DescriptorProto EnumLookup map[string]*descriptorpb.EnumDescriptorProto }
func NewSerializedTypeResolver ¶
func NewSerializedTypeResolver() *SerializedTypeResolver
type TypeResolver ¶
type TypeResolver struct { DescLookup map[string]protoreflect.MessageDescriptor EnumLookup map[string]protoreflect.EnumDescriptor }
func NewTypeResolver ¶
func NewTypeResolver() *TypeResolver
TODO breadchris maybe a better name is type serializer?
func (*TypeResolver) ResolveLookup ¶
func (t *TypeResolver) ResolveLookup(m protoreflect.ProtoMessage) *TypeResolver
func (*TypeResolver) Serialize ¶
func (t *TypeResolver) Serialize() *SerializedTypeResolver
Directories ¶
Path | Synopsis |
---|---|
normalpath
Package normalpath provides functions similar to filepath.
|
Package normalpath provides functions similar to filepath. |
stringutil
Package stringutil implements string utilities.
|
Package stringutil implements string utilities. |