grpcc_config

package
v0.2.10-49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 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    *GrpcClientCfg     `yaml:"grpc_client"`
	Service   *ServiceCfg        `yaml:"service"`
	Resolvers []resolver.Builder `yaml:"-"`
}

Cfg ...

func DefaultCfg

func DefaultCfg() *Cfg

type GrpcClientCfg added in v0.2.11

type GrpcClientCfg 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 (GrpcClientCfg) ToOpts added in v0.2.11

func (t GrpcClientCfg) ToOpts() []grpc.DialOption

type ServiceCfg added in v0.2.11

type ServiceCfg struct {
	Name   string `yaml:"name"`
	Addr   string `yaml:"addr"`
	Scheme string `yaml:"scheme"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL