Skip to content
This repository has been archived by the owner on Nov 27, 2021. It is now read-only.

Latest commit

 

History

History
38 lines (27 loc) · 554 Bytes

README.md

File metadata and controls

38 lines (27 loc) · 554 Bytes

gcache-adapter

Adapters for package gcache.

Requirements

gf version >= v1.14.0 

Or using the master branch.

Installation

go get -u github.com/gogf/gcache-adapter

Usage

Import

import "github.com/gogf/gcache-adapter/adapter"

Normal Cache

cache := gcache.New()
adapter := adapter.NewRedis(g.Redis())
cache.SetAdapter(adapter)

Change Database Cache From In-Memory To Redis

adapter := adapter.NewRedis(g.Redis())
g.DB().GetCache().SetAdapter(adapter)