Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(clientOptions *ClientOptions) *Client
NewClient create Client for business. clientOptions clientOptions can not nil.
func (*Client) DialContext ¶
type ClientConfig ¶
type ClientConfig struct { // handle Timeout time.Duration // conn DialTimeout time.Duration // ms // keepalive KeepTime time.Duration // s KeepTimeOut time.Duration // s PermitWithoutStream bool // debug Debug bool // metric Metrics bool // check slow; ms SlowTime time.Duration // tracer Tracer bool }
type ClientConn ¶
type ClientConn struct {
// contains filtered or unexported fields
}
Collect the grpc.ClientConn instances.
func NewClientConn ¶
func NewClientConn(logger log.Logger) *ClientConn
func (*ClientConn) Close ¶
func (cc *ClientConn) Close()
Close unity closes the grpc.ClientConn instances.
func (*ClientConn) CollectConn ¶
func (cc *ClientConn) CollectConn(conn *grpc.ClientConn)
Examples:
client := grpc.NewClient(clientOptions) ctx := context.Background() conn := client.DialContext(ctx, ":50051") clientConn := NewClientConn() clientConn.CollectConn(conn).
func (*ClientConn) State ¶
func (cc *ClientConn) State() []string
State unity show the grpc.ClientConn state.
type ClientOptional ¶
type ClientOptional func(c *ClientOptions)
func WithDialOptions ¶
func WithDialOptions(options ...grpc.DialOption) ClientOptional
type ClientOptions ¶
type ClientOptions struct {
// contains filtered or unexported fields
}
func NewClientOptions ¶
func NewClientOptions(options ...ClientOptional) *ClientOptions
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(options ...ServerOption) *Server
func (*Server) GracefulShutDown ¶
func (gs *Server) GracefulShutDown()
type ServerConfig ¶
type ServerConfig struct { AppName string Addr string Port string // handle Timeout time.Duration // grpc_server_timeout // conn DialTimeout time.Duration // ms // keepalive KeepTime time.Duration // s KeepTimeOut time.Duration // s // debug Debug bool // metric Metrics bool // check slow; ms SlowTime time.Duration // tracer Tracer bool // validate Validate bool }
type ServerOption ¶
type ServerOption func(c *Server)
type ServerOptions ¶
type ServerOptions struct{}
func (ServerOptions) WithServerOption ¶
func (ServerOptions) WithServerOption(options ...grpc.ServerOption) ServerOption
func (ServerOptions) WithUnarySrvItcp ¶
func (ServerOptions) WithUnarySrvItcp(options ...grpc.UnaryServerInterceptor) ServerOption
type TimeoutCallOption ¶
type TimeoutCallOption struct { *grpc.EmptyCallOption Timeout time.Duration // ms }
func WithTimeout ¶
func WithTimeout(timeout time.Duration) *TimeoutCallOption
Source Files ¶
Click to show internal directories.
Click to hide internal directories.