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
特此免费获得许可,免费授予任何获得此软件副本和相关文档文件(“软件”)的人,以无限制地处理软件,包括无限制的使用权,复制,复制,修改,合并,发布,分发,分发,分发,分配,sublicense和/或允许软件允许与以下条件相关的软件,以下是以下条件。
上述版权通知和此许可通知应包含在软件的所有副本或大量部分中。
该软件是“原样”提供的,没有任何形式的明示或暗示保证,包括但不限于适销性,特定目的的适用性和非侵权的保证。在任何情况下,作者或版权持有人都不应对任何索赔,损害赔偿或其他责任责任,无论是在合同,侵权的诉讼中还是其他责任,是由软件,使用或与软件中的使用或其他交易有关的。