cache

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2025 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ActiveServer = RedisState(0)
	DownServer   = RedisState(1)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	*RedisManager
}

Cache

func NewCache

func NewCache(conf *config.Config) (*Cache, error)

NewCache

func (*Cache) Close added in v0.2.0

func (c *Cache) Close() error

Close 关闭所有Redis连接

type Redis

type Redis struct {
	*redis.Client
	State   RedisState `json:"state"`
	Options *redis.Options
}

func NewRedis

func NewRedis(client *redis.Client, options *redis.Options) *Redis

func (*Redis) GetClient

func (r *Redis) GetClient() *redis.Client

func (Redis) IsEqual

func (r Redis) IsEqual(options *redis.Options) bool

func (*Redis) MarshalJSON

func (this *Redis) MarshalJSON() ([]byte, error)

type RedisManager

type RedisManager struct {
	// contains filtered or unexported fields
}

func NewRedisManager

func NewRedisManager(conf *config.Config) *RedisManager

func (*RedisManager) Close added in v0.2.0

func (rm *RedisManager) Close() error

Close 关闭所有Redis连接

func (*RedisManager) Get

func (rm *RedisManager) Get(redisConfigCenterKey string) (*Redis, error)

type RedisState

type RedisState int

Jump to

Keyboard shortcuts

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