Documentation ¶
Index ¶
- Variables
- type DescriptorSource
- type GrpcClient
- func (c *GrpcClient) Close() error
- func (c *GrpcClient) InvokeWithReflect(method etcd.Method, in io.ReadCloser, ip string, userInfo *auth.UserInfo, ...) (proto.Message, error)
- func (c *GrpcClient) Marshal(w io.Writer, msg proto.Message) error
- func (c *GrpcClient) SearchCallAddr(version, service, method string) (etcd.Method, error)
- type MemoryCache
- type MethodCache
- type ReflectionClient
- func (r *ReflectionClient) Args(service, method string, in io.ReadCloser) (*MethodCache, error)
- func (r *ReflectionClient) Descriptor(dsc desc.Descriptor, service, method string) (*MethodCache, error)
- func (r *ReflectionClient) FindSymbol(service string) (desc.Descriptor, error)
- func (r *ReflectionClient) InvokeUnary(ctx context.Context, msgFactory *dynamic.MessageFactory, ...) (proto.Message, error)
- func (r *ReflectionClient) Marshal(w io.Writer, msg proto.Message) error
- func (r *ReflectionClient) Stub(msgFactory *dynamic.MessageFactory) grpcdynamic.Stub
Constants ¶
This section is empty.
Variables ¶
View Source
var (
MemCache = &MemoryCache{cache: make(map[string]*MethodCache)}
)
View Source
var (
MethodNotFound = errors.New("没有找到对应的方法,请检查您的参数")
)
Functions ¶
This section is empty.
Types ¶
type DescriptorSource ¶
type DescriptorSource interface { // ListServices returns a list of fully-qualified service names. It will be all services in a set of // descriptor files or the set of all services exposed by a gRPC server. ListServices() ([]string, error) // FindSymbol returns a descriptor for the given fully-qualified symbol name. FindSymbol(fullyQualifiedName string) (desc.Descriptor, error) // AllExtensionsForType returns all known extension fields that extend the given message type name. AllExtensionsForType(typeName string) ([]*desc.FieldDescriptor, error) }
func DescriptorSourceFromServer ¶
func DescriptorSourceFromServer(_ context.Context, refClient *grpcreflect.Client) DescriptorSource
type GrpcClient ¶
type GrpcClient struct {
// contains filtered or unexported fields
}
func NewGrpcClient ¶
func NewGrpcClient(service string) (*GrpcClient, error)
func (*GrpcClient) Close ¶
func (c *GrpcClient) Close() error
func (*GrpcClient) InvokeWithReflect ¶
func (c *GrpcClient) InvokeWithReflect(method etcd.Method, in io.ReadCloser, ip string, userInfo *auth.UserInfo, opts ...grpc.CallOption) (proto.Message, error)
func (*GrpcClient) SearchCallAddr ¶
func (c *GrpcClient) SearchCallAddr(version, service, method string) (etcd.Method, error)
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
func (*MemoryCache) GetCache ¶
func (r *MemoryCache) GetCache(service, method string) *MethodCache
func (*MemoryCache) SetCache ¶
func (r *MemoryCache) SetCache(service, method string, cache *MethodCache)
type MethodCache ¶
type MethodCache struct {
// contains filtered or unexported fields
}
type ReflectionClient ¶
type ReflectionClient struct {
// contains filtered or unexported fields
}
func NewReflectionClient ¶
func NewReflectionClient(conn *grpc.ClientConn) *ReflectionClient
func (*ReflectionClient) Args ¶
func (r *ReflectionClient) Args(service, method string, in io.ReadCloser) (*MethodCache, error)
func (*ReflectionClient) Descriptor ¶
func (r *ReflectionClient) Descriptor(dsc desc.Descriptor, service, method string) (*MethodCache, error)
func (*ReflectionClient) FindSymbol ¶
func (r *ReflectionClient) FindSymbol(service string) (desc.Descriptor, error)
func (*ReflectionClient) InvokeUnary ¶
func (r *ReflectionClient) InvokeUnary(ctx context.Context, msgFactory *dynamic.MessageFactory, method *desc.MethodDescriptor, req proto.Message, opts ...grpc.CallOption) (proto.Message, error)
func (*ReflectionClient) Stub ¶
func (r *ReflectionClient) Stub(msgFactory *dynamic.MessageFactory) grpcdynamic.Stub
Click to show internal directories.
Click to hide internal directories.