cache

package
v0.0.47 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package cache provides implementation of cache

Package cache provides implementation of cache

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Start(context.Context)
	Get(string) (interface{}, bool)
	Set(string, interface{})
	Delete(string)
	GetAndDelete(string) (interface{}, bool)
}

Cache represent the cache interface to store cache

func New

func New(opts ...Option) (cc Cache, err error)

New returns the Cache instance or error

type Option

type Option func(*cache)

Option represents the functional option for cache.

func WithExpireCheckDuration

func WithExpireCheckDuration(dur string) Option

WithExpireCheckDuration returns Option after set expireCheckDur when dur is cprrect param.

func WithExpireDuration

func WithExpireDuration(dur string) Option

WithExpireDuration returns Option after set expireDur when dur is cprrect param.

func WithExpiredHook

func WithExpiredHook(f func(context.Context, string)) Option

WithExpiredHook returns Option after set expiredHook when f is not nil.

func WithType

func WithType(mo string) Option

WithType returns Option after set cacher when len(mo string) is not nil.

Directories

Path Synopsis
Package cacher provides implementation of cache type definition
Package cacher provides implementation of cache type definition
Package gache provides implementation of cache using gache Package gache provides implementation of cache using gache
Package gache provides implementation of cache using gache Package gache provides implementation of cache using gache

Jump to

Keyboard shortcuts

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