1 Star 0 Fork 0

wenqingqaq / backend-lib

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
delivery_options.go 473 Bytes
一键复制 编辑 原始数据 按行查看 历史
X0080-闫文清 提交于 2024-03-07 12:32 . first
package metrics
import "github.com/prometheus/client_golang/prometheus"
// ServerOption is an HTTP server option.
type ServerOption func(*Server)
// Address with server address.
func Address(addr string) ServerOption {
return func(s *Server) {
s.address = addr
}
}
func Path(path string) ServerOption {
return func(s *Server) {
s.path = path
}
}
func Gatherer(gatherer prometheus.Gatherer) ServerOption {
return func(s *Server) {
s.gatherer = gatherer
}
}
Go
1
https://gitee.com/yanwenqing/backend-lib.git
git@gitee.com:yanwenqing/backend-lib.git
yanwenqing
backend-lib
backend-lib
ac0283c4995f

搜索帮助