Functional options to persist.Init().
This commit is contained in:
+4
-5
@@ -7,11 +7,10 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
tc := persist.TidyConfig{
|
||||
Interval: 2 * time.Second,
|
||||
Func: persist.ExpireAfter(-5 * time.Second),
|
||||
}
|
||||
persist.Init(persist.Config{Tidy: tc})
|
||||
persist.Init(
|
||||
persist.TidyInterval(2 * time.Second),
|
||||
persist.ExpireAfter(-5 * time.Second),
|
||||
)
|
||||
|
||||
x := persistInt("x",0)
|
||||
persist.Commit()
|
||||
|
||||
Reference in New Issue
Block a user