Go 语言的缓存框架 go-cache

码农软件 · 软件分类 · 缓存系统 · 2019-08-30 14:43:04

软件介绍

go-cache 是 Go 语言实现的一个内存中的缓存框架,实现 Key-Value 的序列存储。

示例代码:

import "github.com/pmylund/go-cache"

// Create a cache with a default expiration time of 5 minutes, and which
// purges expired items every 30 seconds
c := cache.New(5*time.Minute, 30*time.Second)

// Set the value of the key "foo" to "bar", with the default expiration time
c.Set("foo", "bar", 0)

// Set the value of the key "baz" to "yes", with no expiration time
// (the item won't be removed until it is re-set, or removed using
// c.Delete("baz")
c.Set("baz", "yes", -1)

// Get the string associated with the key "foo" from the cache
foo, found := c.Get("foo")
if found {
        fmt.Println(foo)
}

本文地址:https://codercto.com/soft/d/13503.html

高性能Python

高性能Python

(美)戈雷利克、(英)欧日沃尔德 / 东南大学出版社 / 2015-2

你的Python代码也许运行正确,但是你需要运行得更快速。通过探讨隐藏在设计备选方案中的基础理论,戈雷利克和欧日沃尔德编著的《高性能Python》将帮助你更深入地理解Python的实现。你将了解如何定位性能瓶颈,从而显著提升高数据流量程序中的代码执行效率。 你该如何利用多核架构和集群?或者你该如何搭建一个可以自由伸缩而不会影响可靠性的系统?有经验的Python程序员将会学习到这类问题的具体解......一起来看看 《高性能Python》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具