3 Star 5 Fork 3

三三物联网/ssiot-core

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
options.go 717 Bytes
一键复制 编辑 原始数据 按行查看 历史
三三物联网 提交于 2023-04-01 18:08 . 结构调整
/*
* @Author: lwnmengjing
* @Date: 2021/6/3 8:33 上午
* @Last Modified by: lwnmengjing
* @Last Modified time: 2021/6/3 8:33 上午
*/
package writer
// Options 可配置参数
type Options struct {
path string
suffix string //文件扩展名
cap uint
}
func setDefault() Options {
return Options{
path: "/tmp/go-admin",
suffix: "log",
}
}
// Option set options
type Option func(*Options)
// WithPath set path
func WithPath(s string) Option {
return func(o *Options) {
o.path = s
}
}
// WithSuffix set suffix
func WithSuffix(s string) Option {
return func(o *Options) {
o.suffix = s
}
}
// WithCap set cap
func WithCap(n uint) Option {
return func(o *Options) {
o.cap = n
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sansaniot/ssiot-core.git
git@gitee.com:sansaniot/ssiot-core.git
sansaniot
ssiot-core
ssiot-core
v1.6.6

搜索帮助