Documentation ¶
Index ¶
- func DialOpts() []grpc.DialOption
- func ServerOpts() []grpc.ServerOption
- func UnaryClientAuthorize() grpc.UnaryClientInterceptor
- func UnaryClientTimeout(defaultTime time.Duration) grpc.UnaryClientInterceptor
- func UnaryClientTrace() grpc.UnaryClientInterceptor
- func UnaryServerAuthorize() middleware.Middleware
- func UnaryServerTimeout(timeout time.Duration) middleware.Middleware
- func UnaryServerTrace() middleware.Middleware
- type Client
- type ClientObj
- type ClientOption
- func ClientOptions(opts []grpc.DialOption) ClientOption
- func WithAddr(addr string) ClientOption
- func WithMiddle(mw []middleware.Middleware) ClientOption
- func WithStreamInterceptor(stream []grpc.StreamClientInterceptor) ClientOption
- func WithTimeout(tm time.Duration) ClientOption
- func WithUnaryInterceptor(unary []grpc.UnaryClientInterceptor) ClientOption
- type DialOption
- type GRPCClient
- type RegisterObj
- type RegisterObjSet
- type Server
- type ServerOption
- func Address(addr string) ServerOption
- func Listener(l net.Listener) ServerOption
- func Logger(logger logger.Logger) ServerOption
- func Middleware(mw []middleware.Middleware) ServerOption
- func Network(network string) ServerOption
- func ServerOptions(opts []grpc.ServerOption) ServerOption
- func StreamInterceptor(s []grpc.StreamServerInterceptor) ServerOption
- func UnaryInterceptor(u []grpc.UnaryServerInterceptor) ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialOpts ¶
func DialOpts() []grpc.DialOption
func ServerOpts ¶
func ServerOpts() []grpc.ServerOption
func UnaryClientAuthorize ¶ added in v1.3.6
func UnaryClientAuthorize() grpc.UnaryClientInterceptor
func UnaryClientTimeout ¶
func UnaryClientTimeout(defaultTime time.Duration) grpc.UnaryClientInterceptor
func UnaryClientTrace ¶ added in v1.3.6
func UnaryClientTrace() grpc.UnaryClientInterceptor
func UnaryServerAuthorize ¶ added in v1.3.6
func UnaryServerAuthorize() middleware.Middleware
func UnaryServerTimeout ¶
func UnaryServerTimeout(timeout time.Duration) middleware.Middleware
func UnaryServerTrace ¶ added in v1.3.6
func UnaryServerTrace() middleware.Middleware
Types ¶
type Client ¶
type Client struct { *grpc.ClientConn // contains filtered or unexported fields }
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
type ClientOption ¶
type ClientOption func(*Client)
func ClientOptions ¶
func ClientOptions(opts []grpc.DialOption) ClientOption
func WithAddr ¶
func WithAddr(addr string) ClientOption
func WithMiddle ¶
func WithMiddle(mw []middleware.Middleware) ClientOption
func WithStreamInterceptor ¶
func WithStreamInterceptor(stream []grpc.StreamClientInterceptor) ClientOption
func WithTimeout ¶
func WithTimeout(tm time.Duration) ClientOption
func WithUnaryInterceptor ¶
func WithUnaryInterceptor(unary []grpc.UnaryClientInterceptor) ClientOption
type DialOption ¶
type DialOption func() []grpc.DialOption
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
func NewGRPCClient ¶
func NewGRPCClient(objs []*ClientObj, f DialOption, opts ...ClientOption) *GRPCClient
func (*GRPCClient) GetGRPCClient ¶
func (c *GRPCClient) GetGRPCClient(name string) *Client
func (*GRPCClient) Stop ¶
func (c *GRPCClient) Stop()
type RegisterObj ¶
type RegisterObjSet ¶ added in v1.3.6
type RegisterObjSet struct {
Sets []RegisterObj
}
func (*RegisterObjSet) NewGRPCServer ¶ added in v1.3.6
func (r *RegisterObjSet) NewGRPCServer(opts ...ServerOption) *Server
type ServerOption ¶
type ServerOption func(*Server)
func Address ¶
func Address(addr string) ServerOption
func Listener ¶
func Listener(l net.Listener) ServerOption
func Logger ¶
func Logger(logger logger.Logger) ServerOption
func Middleware ¶
func Middleware(mw []middleware.Middleware) ServerOption
func Network ¶
func Network(network string) ServerOption
func ServerOptions ¶
func ServerOptions(opts []grpc.ServerOption) ServerOption
func StreamInterceptor ¶
func StreamInterceptor(s []grpc.StreamServerInterceptor) ServerOption
func UnaryInterceptor ¶
func UnaryInterceptor(u []grpc.UnaryServerInterceptor) ServerOption
Click to show internal directories.
Click to hide internal directories.