cache

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Del

func Del(key string) error

func Exists

func Exists(key string) bool

func Get

func Get(key string) (string, error)

func HDel

func HDel(key, field string) error

func HExists

func HExists(key, field string) bool

func HGet

func HGet(key, field string) (string, error)

func HGetALl

func HGetALl(key, field string) (map[string]string, error)

func HSet

func HSet(key, field string, value interface{}) error

func LPop

func LPop(key string) (string, error)

func LPush

func LPush(key string, values ...interface{}) error

func New

func New(c Cache)

func RPop

func RPop(key string) (string, error)

func Set

func Set(key string, val interface{}, expiration ...time.Duration) error

Types

type Cache

type Cache interface {
	Get(key string) (string, error)
	Set(key string, value interface{}, expiration ...time.Duration) error
	Del(key string) error
	Exists(key string) bool
	Expire(key string, expiration time.Duration) error

	HSet(key, field string, value interface{}) error
	HGet(key, field string) (string, error)
	HGetALl(key, field string) (map[string]string, error)
	HDel(key, field string) error
	HExists(key, field string) bool

	LPush(key string, values ...interface{}) error
	LPop(key string) (string, error)
	RPop(key string) (string, error)
}

type CacheComponent

type CacheComponent struct {
	Cache Cache
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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