Documentation ¶
Index ¶
Constants ¶
const (
// GRPC module name
GRPC = "grpc"
)
Variables ¶
This section is empty.
Functions ¶
func GetProtocol ¶
GetProtocol gets gRPC protocol , will create if null.
Types ¶
type Client ¶
type Client struct { *grpc.ClientConn // contains filtered or unexported fields }
Client is gRPC client include client connection and invoker
type ClientConfig ¶ added in v1.5.0
type ClientConfig struct { // content type, more information refer by https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests ContentSubType string `default:"proto" yaml:"content_sub_type" json:"content_sub_type,omitempty"` }
ClientConfig wrap client call parameters
func GetClientConfig ¶ added in v1.5.0
func GetClientConfig() ClientConfig
GetClientConfig return grpc client custom call options
func GetDefaultClientConfig ¶ added in v1.5.0
func GetDefaultClientConfig() ClientConfig
GetDefaultClientConfig return grpc client default call options
func (*ClientConfig) Validate ¶ added in v1.5.0
func (c *ClientConfig) Validate() error
Validate check if custom config encoding is supported in dubbo grpc
type DubboGrpcService ¶
type DubboGrpcService interface { // SetProxyImpl sets proxy. SetProxyImpl(impl protocol.Invoker) // GetProxyImpl gets proxy. GetProxyImpl() protocol.Invoker // ServiceDesc gets an RPC service's specification. ServiceDesc() *grpc.ServiceDesc }
DubboGrpcService is gRPC service
type GrpcExporter ¶
type GrpcExporter struct {
*protocol.BaseExporter
}
nolint
func NewGrpcExporter ¶
NewGrpcExporter creates a new gRPC exporter
func (*GrpcExporter) Unexport ¶
func (gg *GrpcExporter) Unexport()
Unexport and unregister gRPC service from registry and memory.
type GrpcInvoker ¶
type GrpcInvoker struct { protocol.BaseInvoker // contains filtered or unexported fields }
nolint
func NewGrpcInvoker ¶
func NewGrpcInvoker(url *common.URL, client *Client) *GrpcInvoker
NewGrpcInvoker returns a Grpc invoker instance
func (*GrpcInvoker) Destroy ¶
func (gi *GrpcInvoker) Destroy()
Destroy will destroy gRPC's invoker and client, so it is only called once
func (*GrpcInvoker) Invoke ¶
func (gi *GrpcInvoker) Invoke(ctx context.Context, invocation protocol.Invocation) protocol.Result
Invoke is used to call service method by invocation
func (*GrpcInvoker) IsAvailable ¶
func (gi *GrpcInvoker) IsAvailable() bool
IsAvailable get available status
func (*GrpcInvoker) IsDestroyed ¶
func (gi *GrpcInvoker) IsDestroyed() bool
IsDestroyed get destroyed status
type GrpcProtocol ¶
type GrpcProtocol struct { protocol.BaseProtocol // contains filtered or unexported fields }
GrpcProtocol is gRPC protocol
func NewGRPCProtocol ¶
func NewGRPCProtocol() *GrpcProtocol
NewGRPCProtocol creates new gRPC protocol
func (*GrpcProtocol) Destroy ¶
func (gp *GrpcProtocol) Destroy()
Destroy will destroy gRPC all invoker and exporter, so it only is called once.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a gRPC server
func (*Server) SetBufferSize ¶ added in v1.5.5
type ServerConfig ¶ added in v1.5.0
type ServerConfig struct { }
ServerConfig currently is empty struct,for future expansion
func GetDefaultServerConfig ¶ added in v1.5.0
func GetDefaultServerConfig() ServerConfig
GetDefaultServerConfig currently return empty struct,for future expansion
func (*ServerConfig) Validate ¶ added in v1.5.0
func (c *ServerConfig) Validate() error
Validate currently return empty struct,for future expansion
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
just for test, never use internal for production.
|
just for test, never use internal for production. |
plugin/dubbo
Package dubbo plugin for protobuf.
|
Package dubbo plugin for protobuf. |