{"modulePath":"github.com/mangk/adminBox","version":"v0.1.2","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cache\n\nPackage cache provides in-memory caching with a built-in captcha store.\n\nThe local cache is backed by gkit's local\\_cache and supports TTL-based expiration. The Base64CaptchaStore implements the captcha store interface for verification code storage.\n\n## Functions\n\n```go\nfunc Local() local_cache.Cache\n```\n\n```go\nfunc Redis(driver ...string) *redis.Client\n```\n\n```go\nfunc RedisDel(key string)\n```\n\n```go\nfunc RedisHasOrQuery(key string, queryFunc func() (data string, exp time.Duration)) string\n```\n\n```go\nfunc RedisHasOrQueryByte(key string, queryFunc func() (data []byte, exp time.Duration)) []byte\n```\n\n```go\nfunc RedisHasOrQuerySerializerGob[T any](key string, resultReceiver *T, queryFunc func(*T) (expirationTime time.Duration, err error)) error\n```\n\n```go\nfunc RedisStrGet(key string) string\n```\n\n```go\nfunc RedisStrSet(key, value string, exp time.Duration)\n```\n\n## Types\n\n```go\ntype Base64CaptchaStore struct {\n}\n```\nTODO 验证码使用本地缓存，在多机部署时会存在问题\n\n```go\nfunc (b Base64CaptchaStore) Get(id string, clear bool) string\n```\n\n```go\nfunc (b Base64CaptchaStore) Set(id string, value string) error\n```\n\n```go\nfunc (b Base64CaptchaStore) Verify(id string, answer string, clear bool) bool\n```\n\n","path":"github.com/mangk/adminBox/pkg/cache","name":"cache","synopsis":"Package cache provides in-memory caching with a built-in captcha store.","isRedistributable":true}
