3 Star 5 Fork 3

三三物联网/ssiot-core

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
options.go 717 Bytes
Copy Edit Raw Blame History
三三物联网 authored 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.7.8

Search