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 NewClient ¶
func NewClient(serviceName string, interceptors ...grpc.UnaryClientInterceptor) (*PClient, error)
func (*PClient) Conn ¶
func (p *PClient) Conn() *grpc.ClientConn
func (*PClient) DialByEndPoint ¶
func (p *PClient) DialByEndPoint(adrss string) (*grpc.ClientConn, error)
type PServer ¶
type PServer struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(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.