cache

package
v1.7.12 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 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

func New

func New[V any](opts ...Option[V]) (cc cacher.Cache[V], err error)

New returns the Cache instance or error.

Types

type Option

type Option[V any] func(*cache[V])

Option represents the functional option for cache.

func WithExpireCheckDuration

func WithExpireCheckDuration[V any](dur string) Option[V]

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

func WithExpireDuration

func WithExpireDuration[V any](dur string) Option[V]

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

func WithExpiredHook

func WithExpiredHook[V any](f func(context.Context, string)) Option[V]

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

func WithType

func WithType[V any](mo string) Option[V]

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

Jump to

Keyboard shortcuts

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