config

package
v1.1.17 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: GPL-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const RpcByGRpc = "grpc"
View Source
const RpcByHttp = "http"

rpc 请求方式

View Source
const RpcRegByEtcd = "etcd"
View Source
const RpcRegByNone = "none"

rpc注册方式

Variables

This section is empty.

Functions

This section is empty.

Types

type DBConfig

type DBConfig struct {
	DbHost     string `yaml:"DbHost"`
	DbPort     string `yaml:"DbPort"`
	DbUser     string `yaml:"DbUser"`
	DbPassword string `yaml:"DbPassword"`
	DbName     string `yaml:"DbName"`

	MaxIdleConns int    `default:"0" yaml:"MaxIdleConns"`    //预留并发链接数
	MaxOpenConns int    `default:"0" yaml:"MaxOpenConns"`    //最大支持链接
	MaxLifetime  int    `default:"0" yaml:"ConnMaxLifetime"` //每个链接最大生存时间
	MaxIdleTime  int    `default:"0" yaml:"ConnMaxIdleTime"` //每个链接最大空闲时间
	MaxConcatLen string `default:"" yaml:"MaxConcatLen"`
}

type GRpcServerConfig

type GRpcServerConfig struct {
	RpcLisAddr   string `yaml:"RpcLisAddr"`   //grpc启动端口,如 ":4001"
	RpcRegWay    string `yaml:"RpcRegister"`  //服务注册方式:none/etcd
	RpcRegServer string `yaml:"RpcRegServer"` //服务注册服务端地址,如etcd地址
}

服务端grpc配置

type RpcClientConfig

type RpcClientConfig struct {
	RpcWay     string `yaml:"RpcWay"`     //rpc服务方式
	RpcTimeout int64  `yaml:"RpcTimeout"` //rpc超时时间,单位:秒
	RpcAddr    string `yaml:"RpcAddr"`    //rpc请求地址

	RpcDisWay    string `yaml:"RpcDisWay"`    //服务发现方式:none/etcd
	RpcDisServer string `yaml:"RpcDisServer"` //服务发现服务端地址,如etcd地址
}

客户端rpc配置

Jump to

Keyboard shortcuts

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