cache

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultTTL = time.Minute // 默认生存时间
)

Functions

This section is empty.

Types

type Cache

type Cache interface {
	registry.Registry
	Stop()
}

func New

func New(r registry.Registry, opts ...Option) Cache

New 创建一个新的cache

type Option

type Option func(o *Options)

func WithTTL

func WithTTL(t time.Duration) Option

WithTTL sets the cache TTL

type Options

type Options struct {
	// TTL 缓存的生命周期
	TTL time.Duration
}

Jump to

Keyboard shortcuts

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