gache

package
v1.7.17 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package gache provides implementation of cache using gache

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New[V any](opts ...Option[V]) cacher.Cache[V]

New loads a cache model and returns a new cache struct.

Types

type Option

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

Option represents the functional option for cache.

func WithExpireCheckDuration

func WithExpireCheckDuration[V any](dur time.Duration) Option[V]

WithExpireCheckDuration returns Option after set expireCheckDur when dur is not 0.

func WithExpireDuration

func WithExpireDuration[V any](dur time.Duration) Option[V]

WithExpireDuration returns Option after set expireDur when dur is not 0.

func WithExpiredHook

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

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

func WithGache

func WithGache[V any](g gache.Gache[V]) Option[V]

WithGache returns Option after set gache to cache.

Jump to

Keyboard shortcuts

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