Documentation
¶
Index ¶
- Constants
- func CachingMiddleware() func(http.Handler) http.Handler
- func IsEnabled() bool
- func RespMiddleware(next http.Handler) http.Handler
- func SaveToCache(ctx context.Context, queryStr string, data interface{}) error
- func SetupCache(redisAddress string, password string, ttl time.Duration, db int) error
- type Cache
- type CacheResponseWriter
Constants ¶
View Source
const AppPrefix = "dega:"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
var GlobalCache *Cache
GlobalCache: global cache
type CacheResponseWriter ¶
type CacheResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
func (*CacheResponseWriter) Write ¶
func (myrw *CacheResponseWriter) Write(p []byte) (int, error)
Here we are implementing a Write() function from ResponseWriter with our custom instructions.
func (*CacheResponseWriter) WriteHeader ¶
func (myrw *CacheResponseWriter) WriteHeader(header int)
Click to show internal directories.
Click to hide internal directories.