bettercache
v2.0.4

go get -u github.com/realTristan/bettercache
package main
// Import Packages
import (
"fmt"
bc "github.com/realTristan/bettercache"
)
func main () {
// Initialize the cache
var c * bc. Cache = bc . Init ( - 1 ) // -1 (no size limit)
// Add key1 to the cache
c . Set ( "key1" , "value1" , true )
// Get key from the cache
var data string = c . Get ( "key1" )
fmt . Println ( data )
// Full Text Search for the key's contents
var res [] string = c . FullTextSearch ( & bc. TextSearch {
Limit : - 1 , // No limit
Query : [] byte ( "value" ), // Search for "value"
StrictMode : false , // Ignore CAPS
})
fmt . Println ( res )
// Remove key1 from the cache
var removedKey string = c . Remove ( "key1" )
fmt . Println ( removedKey )
}麻省理工學院許可證
版權(C)2022 Tristan Simpson
特此免費授予獲得此軟件副本和相關文檔文件副本(“軟件”)的任何人,以無限制處理該軟件,包括無限制的使用權,複製,複製,修改,合併,合併,發布,分發,分發,分發,訂婚,和/或允許軟件的副本,並允許對以下條件提供以下條件,以下是以下條件。
上述版權通知和此許可通知應包含在軟件的所有副本或大量部分中。
該軟件是“原樣”提供的,沒有任何形式的明示或暗示保證,包括但不限於適銷性,特定目的的適用性和非侵權的保證。在任何情況下,作者或版權持有人都不應對任何索賠,損害賠償或其他責任責任,無論是在合同,侵權的訴訟中還是其他責任,是由軟件,使用或與軟件中的使用或其他交易有關的。