grpc

package
v0.0.0-...-da789b0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 40 Imported by: 3

Documentation

Index

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 EnumerateResourceBlocks(server *pgrpc.Server, isLangService bool) ([]*gen.Node, error)

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

TODO breadchris placeholder until the above is implemented

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 (r *RpcResult) OnReceiveHeaders(md metadata.MD)

func (*RpcResult) OnReceiveResponse

func (r *RpcResult) OnReceiveResponse(m proto.Message)

func (*RpcResult) OnReceiveTrailers

func (r *RpcResult) OnReceiveTrailers(stat *status.Status, md metadata.MD)

func (*RpcResult) OnResolveMethod

func (*RpcResult) OnResolveMethod(*desc.MethodDescriptor)

func (*RpcResult) OnSendHeaders

func (*RpcResult) OnSendHeaders(metadata.MD)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL