Code pull completed, the page will refresh automatically
Micache: мини-кэш файлов на Go
$ go get gitee.com/migopher/micache
package main
import "gitee.com/migopher/micache"
func main() {
// устанавливаем путь к файлу кэша cache/
micache.Dir = "cache/"
}
package main
import "gitee.com/migopher/micache"
func main() {
// задаём время истечения срока действия ключа 3600 секунд или 0 для постоянного сохранения
micache.Set("go", "golang", 3600)
}
package main
import (
"fmt"
"gitee.com/migopher/micache"
)
func main() {
// извлекаем значение ключа из кэша
v := micache.Get("go")
fmt.Println(v)
}
package main
import (
"fmt"
"gitee.com/migopher/micache"
)
type User struct {
Uid int
UserName string
}
func main() {
getUser := User{}
micache.GetDecoding("go", &getUser)
fmt.Println(getUser)
}
package main
import (
"fmt"
"gitee.com/migopher/micache"
)
func main() {
b := micache.IsExist("go")
fmt.Println(b)
}
package main
import (
"fmt"
"gitee.com/migopher/micache"
)
func main() {
b := micache.Delete("go")
fmt.Println(b)
}
You can comment after Login
Inappropriate content may be displayed here and will not be shown on the page. You can check and modify it through the relevant editing function
If you confirm that the content does not involve inappropriate language/advertisement redirection/violence/vulgar pornography/infringement/piracy/false/insignificant or illegal content related to national laws and regulations, you can click submit to make an appeal, and we will handle it as soon as possible.
Comments ( 0 )