cache

package
v1.20.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type C

type C interface {
	Get(key string, value interface{}) (err error)
	GetSkipLocal(key string, value interface{}) (err error)
	GetProxy() *cache.Cache
	Exists(key string) bool
	Set(key string, value interface{}) (err error)
	SetTTL(key string, value interface{}, ttl time.Duration) (err error)
	Del(key string) error
}

func New

func New(ctx context.Context, redisOpts RedisOptions, cacheOpts Options) (c C)

New *

c := New(ctx, RedisOptions{
		Addr: addr,
		Password: "redisUAT",
	}, Options{
		MaxSize: 10,
		Ttl:     time.Second*20,
	})

type Options

type Options struct {
	MaxSize int
	Ttl     time.Duration
}

type RedisOptions

type RedisOptions redis.Options

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL