<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          go-cacheGo 語言的緩存框架

          聯(lián)合創(chuàng)作 · 2023-09-29 06:23

          go-cache 是 Go 語言實(shí)現(xiàn)的一個(gè)內(nèi)存中的緩存框架,實(shí)現(xiàn) Key-Value 的序列存儲(chǔ)。

          示例代碼:

          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)
          }
          瀏覽 34
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  韩国一区二区在线观看 | 激情自拍视频网 | 国产18禁黄网站禁片免费视频 | 永久AV免费网站 | 91亚洲精品久久久久蜜桃 |