readme md
parent
f4d9a23e79
commit
f70e396bca
18
README.md
18
README.md
|
@ -131,23 +131,6 @@ map, struct, func
|
|||
# Пример использования
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"main/candycache"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Person struct {
|
||||
Name string
|
||||
Age int
|
||||
Hobbies []string
|
||||
}
|
||||
|
||||
func main() {
|
||||
cache := candycache.Cacher(10 * time.Minute) // Создаем кэш с интервалом очистки 10 минут
|
||||
|
||||
cache.Set("key1", "string", 5*time.Minute)
|
||||
|
@ -187,5 +170,4 @@ func main() {
|
|||
for _, i := range list {
|
||||
fmt.Println(i.Key, i.Item.Data(), i.Item.DestroyTimestamp())
|
||||
}
|
||||
}
|
||||
```
|
Loading…
Reference in New Issue