gache

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package gache provides implementation of cache using gache

Package gache provides implementation of cache using gache

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...Option) (c *cache)

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

Types

type Option

type Option func(*cache)

Option represents the functional option for cache.

func WithExpireCheckDuration

func WithExpireCheckDuration(dur time.Duration) Option

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

func WithExpireDuration

func WithExpireDuration(dur time.Duration) Option

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

func WithExpiredHook

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

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

func WithGache

func WithGache(g gache.Gache) Option

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