Documentation
¶
Index ¶
- type Client
- func (c *Client) Dial(ctx context.Context, scode string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func (c *Client) UseDialOption(opts ...grpc.DialOption) *Client
- func (c *Client) UseStreamInterceptor(handlers ...grpc.StreamClientInterceptor) *Client
- func (c *Client) UseUnaryInterceptor(handlers ...grpc.UnaryClientInterceptor) *Client
- type Config
- type Server
- type TLSConfig
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
}
Client 客户端
func (*Client) Dial ¶
func (c *Client) Dial(ctx context.Context, scode string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
Dial 用于创建连接
func (*Client) UseDialOption ¶
func (c *Client) UseDialOption(opts ...grpc.DialOption) *Client
UseDialOption 用于添加自定义连接参数
func (*Client) UseStreamInterceptor ¶
func (c *Client) UseStreamInterceptor(handlers ...grpc.StreamClientInterceptor) *Client
UseStreamInterceptor 用于添加自定义客户端流拦截器
func (*Client) UseUnaryInterceptor ¶
func (c *Client) UseUnaryInterceptor(handlers ...grpc.UnaryClientInterceptor) *Client
UseUnaryInterceptor 用于添加自定义客户端一元拦截器
type Config ¶
type Config struct {
GRPCAddress string
HTTPAddress string
KeepaliveTimeout time.Duration
// client
Scheme string
Authority string
APIEndpoint string
// tls
TLS *TLSConfig
// contains filtered or unexported fields
}
Config server config
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server server instance
func (*Server) RegisterGateway ¶
RegisterGateway return the http server for registering service
func (*Server) UseServerOption ¶
func (s *Server) UseServerOption(opts ...grpc.ServerOption) *Server
UseServerOption 用于设置选项并初始化grpc server
Click to show internal directories.
Click to hide internal directories.