cache

package
v0.0.0-...-5c0bb04 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Redis     = "redis"
	Memcached = "memcached"
	PDO       = "pdo"
)

cache type

Variables

This section is empty.

Functions

func Clear

func Clear() error

Clear clear all value in cache

func Close

func Close()

Close for cache

func Delete

func Delete(key string) error

Delete delete value in cache

func DeleteMultiple

func DeleteMultiple(keys []string) error

DeleteMultiple delete multiple value in cache

func Get

func Get(key, defaultV string) string

Get get value in cache

func GetMultiple

func GetMultiple(keys []string, defaultV string) map[string]string

GetMultiple get multiple value in cache

func Has

func Has(key string) bool

Has as exist

func Init

func Init()

Init for cache

func Set

func Set(key, value string, ttl int) error

Set set value to cache

func SetMultiple

func SetMultiple(args map[string]string, ttl int) error

SetMultiple set multiple value to cache

Types

type Psr16Cache

type Psr16Cache interface {
	Get(key, defaultV string) string
	Set(key, value string, ttl int) error
	Delete(key string) error
	Clear() error
	GetMultiple(keys []string, defaultV string) map[string]string
	SetMultiple(args map[string]string, ttl int) error
	DeleteMultiple(keys []string) error
	Has(key string) bool
	Close()
}

Psr16Cache ref php Psr16Cache Ref: https://github.com/symfony/symfony/blob/5.x/src/Symfony/Component/Cache/Psr16Cache.php

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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