cache

package
v0.0.46 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 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)

func WithExpireCheckDuration

func WithExpireCheckDuration(dur string) Option

func WithExpireDuration

func WithExpireDuration(dur string) Option

func WithExpiredHook

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

func WithType

func WithType(mo string) Option

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