Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PClient ¶
type PClient struct {
// contains filtered or unexported fields
}
func NewPClient ¶
func NewPClient(serviceName string, interceptors ...grpc.UnaryClientInterceptor) (*PClient, error)
func (*PClient) Conn ¶
func (p *PClient) Conn() *grpc.ClientConn
type PServer ¶
type PServer struct {
// contains filtered or unexported fields
}
func NewPServer ¶
func NewPServer(opts ...ServerOption) *PServer
func (*PServer) RegisterService ¶
func (p *PServer) RegisterService(register ...RegisterFn)
eg :
p.RegisterService(func(server *grpc.Server) { test.RegisterGreeterServer(server, &Server{}) })
func (*PServer) RegisterUnaryServerInterceptor ¶
func (p *PServer) RegisterUnaryServerInterceptor(i grpc.UnaryServerInterceptor)
注册自定义拦截器,例如限流拦截器或者自己的一些业务自定义拦截器
type RegisterFn ¶
type ServerOption ¶
type ServerOption func(opts *serverOptions)
Click to show internal directories.
Click to hide internal directories.