Skip to content

PrimaKu/cache

Repository files navigation

Cache Manager

A Go library for managing cache with Redis.

Installation

go get github.com/PrimaKu/cache

Setup

cacheManager, err := cache.NewCacheManager(redisOptions) // *redis.Options
if err != nil {
  log.Fatalf("Failed to start caching with: %v", err)
}

Get Cache

data := cacheManager.Get(context, "DATA_KEY")

Set Cache

err := cacheManager.Set(context, "DATA_KEY", "value to cache")

Delete Cache

err := cacheManager.Del(context, "DATA_KEY")

About

A Go library for managing cache with Redis.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages