Documentation ¶
Index ¶
- func Dial(ctx context.Context, opts ...ClientOption) (*grpc.ClientConn, error)
- func DialInsecure(ctx context.Context, opts ...ClientOption) (*grpc.ClientConn, error)
- func NewWrappedStream(ctx context.Context, stream grpc.ServerStream) grpc.ServerStream
- type ClientOption
- func WithClientDialOptions(opts ...grpc.DialOption) ClientOption
- func WithClientDiscovery(d registry.Discovery) ClientOption
- func WithClientEndpoint(endpoint string) ClientOption
- func WithClientMiddleware(m ...middleware.Middleware) ClientOption
- func WithClientTLSConfig(c *tls.Config) ClientOption
- func WithClientTimeout(timeout time.Duration) ClientOption
- func WithClientUnaryInterceptor(in ...grpc.UnaryClientInterceptor) ClientOption
- type Server
- type ServerOption
- func WithServerAddress(addr string) ServerOption
- func WithServerListener(lis net.Listener) ServerOption
- func WithServerMiddleware(m ...middleware.Middleware) ServerOption
- func WithServerNetwork(network string) ServerOption
- func WithServerOption(opts ...grpc.ServerOption) ServerOption
- func WithServerTLSConfig(c *tls.Config) ServerOption
- func WithServerTimeout(timeout time.Duration) ServerOption
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
func Dial(ctx context.Context, opts ...ClientOption) (*grpc.ClientConn, error)
func DialInsecure ¶
func DialInsecure(ctx context.Context, opts ...ClientOption) (*grpc.ClientConn, error)
func NewWrappedStream ¶
func NewWrappedStream(ctx context.Context, stream grpc.ServerStream) grpc.ServerStream
Types ¶
type ClientOption ¶
type ClientOption func(o *client)
func WithClientDialOptions ¶
func WithClientDialOptions(opts ...grpc.DialOption) ClientOption
func WithClientDiscovery ¶
func WithClientDiscovery(d registry.Discovery) ClientOption
func WithClientEndpoint ¶
func WithClientEndpoint(endpoint string) ClientOption
func WithClientMiddleware ¶
func WithClientMiddleware(m ...middleware.Middleware) ClientOption
func WithClientTLSConfig ¶
func WithClientTLSConfig(c *tls.Config) ClientOption
func WithClientTimeout ¶
func WithClientTimeout(timeout time.Duration) ClientOption
func WithClientUnaryInterceptor ¶
func WithClientUnaryInterceptor(in ...grpc.UnaryClientInterceptor) ClientOption
type Server ¶
func NewServer ¶
func NewServer(opts ...ServerOption) *Server
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)
func WithServerAddress ¶
func WithServerAddress(addr string) ServerOption
WithServerAddress with server address like `0.0.0.0:9000`. default is `:0`
func WithServerListener ¶
func WithServerListener(lis net.Listener) ServerOption
WithServerListener with server lis
func WithServerMiddleware ¶
func WithServerMiddleware(m ...middleware.Middleware) ServerOption
WithServerMiddleware with server middleware.
func WithServerNetwork ¶
func WithServerNetwork(network string) ServerOption
WithServerNetwork with server network. default is `tcp`
func WithServerOption ¶
func WithServerOption(opts ...grpc.ServerOption) ServerOption
WithServerOption with grpc options.
func WithServerTLSConfig ¶
func WithServerTLSConfig(c *tls.Config) ServerOption
WithServerTLSConfig with TLS config.
func WithServerTimeout ¶
func WithServerTimeout(timeout time.Duration) ServerOption
WithServerTimeout with server timeout.
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func (*Transport) ReplyHeader ¶
func (*Transport) RequestHeader ¶
Click to show internal directories.
Click to hide internal directories.