Documentation ¶
Index ¶
- func Extract(hostPort string, lis net.Listener) (string, error)
- func GetStream(ctx context.Context) grpc.ServerStream
- func NewWrappedStream(ctx context.Context, stream grpc.ServerStream, m matcher.Matcher) grpc.ServerStream
- func Port(lis net.Listener) (int, bool)
- func Scheme(scheme string, isSecure bool) string
- type Server
- type ServerOption
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWrappedStream ¶
func NewWrappedStream(ctx context.Context, stream grpc.ServerStream, m matcher.Matcher) grpc.ServerStream
Types ¶
type Server ¶
Server is a gRPC server wrapper.
func NewServer ¶
func NewServer(opts ...ServerOption) *Server
NewServer creates a gRPC server by options.
func (*Server) Endpoint ¶
Endpoint return a real address to registry endpoint. examples:
grpc://127.0.0.1:9000?isSecure=false
func (*Server) Use ¶
func (s *Server) Use(selector string, m ...middleware.Middleware)
Use uses a service middleware with selector. selector:
- '/*'
- '/helloworld.v1.Greeter/*'
- '/helloworld.v1.Greeter/SayHello'
type ServerOption ¶
type ServerOption func(o *Server)
ServerOption is gRPC server option.
func Middleware ¶
func Middleware(m ...middleware.Middleware) ServerOption
Middleware with server middleware.
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is a gRPC transport.
func (*Transport) ReplyHeader ¶
ReplyHeader returns the reply header.
func (*Transport) RequestHeader ¶
RequestHeader returns the request header.
Click to show internal directories.
Click to hide internal directories.