mirror of
https://github.com/gofiber/storage.git
synced 2025-10-01 06:42:18 +08:00
25 lines
420 B
Go
25 lines
420 B
Go
package pebble
|
|
|
|
import "github.com/cockroachdb/pebble"
|
|
|
|
type Config struct {
|
|
Path string
|
|
WriteOptions *pebble.WriteOptions
|
|
}
|
|
|
|
var ConfigDefault = Config{
|
|
Path: "db",
|
|
WriteOptions: &pebble.WriteOptions{},
|
|
}
|
|
|
|
func configDefault(config ...Config) Config {
|
|
if len(config) < 1 {
|
|
return configDefault(config...)
|
|
}
|
|
cfg := config[0]
|
|
if cfg.Path == "" {
|
|
cfg.Path = ConfigDefault.Path
|
|
}
|
|
return cfg
|
|
}
|