Documentation ¶
Overview ¶
client 当项目有对外提供服务时, client 协助使用者方便高效的使用服务. 一般用于 rpc 服务, 该 pkg 提供 ServiceClient 的创建, 以及相关函数的封装, 或添加部分自定义逻辑(如校验), 从而用起来更方便高效.
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 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.