cache

package
v0.0.0-...-a28d39e Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(cf *Configuration) error

Types

type Configuration

type Configuration struct {
	Host     string
	Port     int
	Username string
	Password string
	DB       int
}

Configuration config Redis connection

type Connection

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

Client redis

func GetConnection

func GetConnection() *Connection

GetConnection get client connection

func (*Connection) Delete

func (c *Connection) Delete(key string) error

func (*Connection) Get

func (c *Connection) Get(key string, value interface{}) error

func (*Connection) GetKeys

func (c *Connection) GetKeys(pattern string) ([]string, error)

func (*Connection) Set

func (c *Connection) Set(key string, value interface{}, expiredTime time.Duration) error

type Service

type Service interface {
	Set(key string, value interface{}, expiredTime time.Duration) error
	Get(key string, value interface{}) error
	GetKeys(pattern string) ([]string, error)
	Delete(key string) error
}

Service service interface

Jump to

Keyboard shortcuts

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