2 Star 2 Fork 3

trackertrader/rpcx

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
option.go 775 Bytes
一键复制 编辑 原始数据 按行查看 历史
kevinyang 提交于 2021-07-05 10:32 +08:00 . add
package server
import (
"crypto/tls"
"time"
)
// OptionFn configures options of server.
type OptionFn func(*Server)
// // WithOptions sets multiple options.
// func WithOptions(ops map[string]interface{}) OptionFn {
// return func(s *Server) {
// for k, v := range ops {
// s.options[k] = v
// }
// }
// }
// WithTLSConfig sets tls.Config.
func WithTLSConfig(cfg *tls.Config) OptionFn {
return func(s *Server) {
s.tlsConfig = cfg
}
}
// WithReadTimeout sets readTimeout.
func WithReadTimeout(readTimeout time.Duration) OptionFn {
return func(s *Server) {
s.readTimeout = readTimeout
}
}
// WithWriteTimeout sets writeTimeout.
func WithWriteTimeout(writeTimeout time.Duration) OptionFn {
return func(s *Server) {
s.writeTimeout = writeTimeout
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/trackertrader/rpcx.git
git@gitee.com:trackertrader/rpcx.git
trackertrader
rpcx
rpcx
v1.1.6

搜索帮助