Categorygithub.com/core-go/redis
modulepackage
1.0.3
Repository: https://github.com/core-go/redis.git
Documentation: pkg.go.dev

# README

Redis Client

  • Redis Client Utilities, support 2 libraries redigo/redis and redis/go-redis (v6, v8, v9)
  • Redis Health Check
  • Implement CacheAdapter (Memory Cache), which is the implementation of the belowinterface:
package cache

import (
  "context"
  "time"
)

type CachePort interface {
  Get(ctx context.Context, key string) (string, error)
  GetMany(ctx context.Context, keys []string) (map[string]string, []string, error)
  ContainsKey(ctx context.Context, key string) (bool, error)
  Put(ctx context.Context, key string, value interface{}, expire time.Duration) error
  Expire(ctx context.Context, key string, expire time.Duration) (bool, error)
  Remove(ctx context.Context, key string) (bool, error)
  Clear(ctx context.Context) error
  Count(ctx context.Context) (int64, error)
  Keys(ctx context.Context) ([]string, error)
  Size(ctx context.Context) (int64, error)
  Close(ctx context.Context) error
}
  • Implement RedisAdapter, which is the implementation of the above interface

Sample

Installation

Please make sure to initialize a Go module before installing core-go/redis:

go get -u github.com/core-go/redis

Import:

import "github.com/core-go/redis"

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author