grpcc_config

package
v0.2.24 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 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 BackoffConfig added in v0.2.21

type BackoffConfig struct {
	BaseDelay  time.Duration `json:"base_delay"`
	Multiplier float64       `json:"multiplier"`
	Jitter     float64       `json:"jitter"`
	MaxDelay   time.Duration `json:"max_delay"`
}

BackoffConfig defines the configuration options for backoff.

type CallParameters added in v0.2.21

type CallParameters struct {
	Header                map[string]string `json:"header"`
	Trailer               map[string]string `json:"trailer"`
	WaitForReady          bool              `json:"wait_for_ready"`
	FailFast              bool              `json:"fail_fast"`
	MaxCallRecvMsgSize    int               `json:"max_call_recv_msg_size"`
	MaxCallSendMsgSize    int               `json:"max_call_send_msg_size"`
	UseCompressor         string            `json:"use_compressor"`
	CallContentSubtype    string            `json:"call_content_subtype"`
	ForceCodec            string            `json:"force_codec"`
	MaxRetryRPCBufferSize int               `json:"max_retry_rpc_buffer_size"`
}

type Cfg

type Cfg struct {
	Client    *GrpcClientCfg     `yaml:"grpc_client"`
	Service   *ServiceCfg        `yaml:"service"`
	Resolvers []resolver.Builder `yaml:"-" json:"-"`
}

Cfg ...

func DefaultCfg

func DefaultCfg() *Cfg

type ClientParameters added in v0.2.21

type ClientParameters struct {
	PermitWithoutStream bool          `json:"permit_without_stream"`
	Time                time.Duration `json:"time"`
	Timeout             time.Duration `json:"timeout"`
}

type ConnectParams added in v0.2.21

type ConnectParams struct {
	Backoff           BackoffConfig `json:"backoff"`
	MinConnectTimeout time.Duration `json:"min_connect_timeout"`
}

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"`
	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