Documentation ¶
Index ¶
Constants ¶
View Source
const ( Name = "grpcc" // DefaultTimeout 默认的连接超时时间 DefaultTimeout = 2 * time.Second DefaultContentType = "application/grpc" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cfg ¶
type Cfg struct { Client *ClientCfg `yaml:"client"` Srv string `yaml:"srv"` Addr string `yaml:"addr"` Scheme string `yaml:"scheme"` Middleware []string `yaml:"middleware"` }
Cfg ...
func DefaultCfg ¶
func DefaultCfg() *Cfg
type ClientCfg ¶
type ClientCfg struct { MaxMsgSize int `json:"max_msg_size"` Codec string `json:"codec"` Compressor string `json:"compressor"` Decompressor string `json:"decompressor"` Balancer string `json:"balancer"` BackoffMaxDelay time.Duration `json:"backoff_max_delay"` Timeout time.Duration `json:"timeout"` DialTimeout time.Duration `json:"dial_timeout"` MaxDelay time.Duration `json:"max_delay"` UserAgent string `json:"user_agent"` Authority string `json:"authority"` DisableServiceConfig bool `json:"disable_service_config"` DefaultServiceConfig string `json:"default_service_config"` DisableRetry bool `json:"disable_retry"` // MaxHeaderListSize 每次调用允许发送的header的最大条数 MaxHeaderListSize uint32 `json:"max_header_list_size"` DisableHealthCheck bool `json:"disable_health_check"` Insecure bool `json:"insecure"` Block bool `json:"block"` IdleNum uint32 `json:"idle_num"` WriteBuffer int `json:"write_buffer"` ReadBuffer int `json:"read_buffer"` WindowSize int32 `json:"window_size"` ConnWindowSize int32 `json:"conn_window_size"` // MaxRecvMsgSize maximum message that Client can receive (4 MB). MaxRecvMsgSize int `json:"max_recv_msg_size"` NoProxy bool `json:"no_proxy"` Proxy bool `json:"proxy"` ConnectParams connectParams `json:"connect_params"` ClientParameters clientParameters `json:"client_parameters"` Call callParameters `json:"call"` }
func (ClientCfg) ToOpts ¶
func (t ClientCfg) ToOpts() []grpc.DialOption
Click to show internal directories.
Click to hide internal directories.