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
}
Client Base grpc client
type DemoClient ¶
type DemoClient struct { IClient pb.DemoServiceClient }
DemoClient Demo rpc client
func NewDemoClient ¶
func NewDemoClient(opts Options) (*DemoClient, error)
NewDemoClient 创建一个连接 demo 的 gRPC 客户端。
type IDemoClient ¶
type IDemoClient interface { IClient pb.DemoServiceClient }
IDemoClient DemoClient interface
type Options ¶
type Options struct { // Address 服务的地址,IP和端口 Address string `json:"address" yaml:"address" mapstructure:"address"` // DialTimeout 连接超时时间,单位秒 DialTimeout int64 `json:"dial_timeout" yaml:"dial_timeout" mapstructure:"dial_timeout"` // KeepAliveTime 连接保活周期,单位秒 KeepAliveTime int64 `json:"keep_alive_time" yaml:"keep_alive_time" mapstructure:"keep_alive_time"` // KeepAliveTimeout 发送保活心跳包的超时时间,单位秒 KeepAliveTimeout int64 `json:"keep_alive_timeout" yaml:"keep_alive_timeout" mapstructure:"keep_alive_timeout"` }
Options 客户端连接参数。
Click to show internal directories.
Click to hide internal directories.