ttlcache

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryTTLCache

type InMemoryTTLCache struct {
	// contains filtered or unexported fields
}

func NewInMemoryTTLCache

func NewInMemoryTTLCache() *InMemoryTTLCache

func (*InMemoryTTLCache) Get

func (*InMemoryTTLCache) Set

func (c *InMemoryTTLCache) Set(_ context.Context, key string, value string, ttl time.Duration) error

type RueidisTTLCache

type RueidisTTLCache struct {
	// contains filtered or unexported fields
}

func NewRueidisTTLCache

func NewRueidisTTLCache(client rueidis.Client) *RueidisTTLCache

func (*RueidisTTLCache) Get

func (c *RueidisTTLCache) Get(ctx context.Context, key string) (mo.Option[string], error)

func (*RueidisTTLCache) Set

func (c *RueidisTTLCache) Set(ctx context.Context, key string, value string, ttl time.Duration) error

type TTLCache

type TTLCache interface {
	Get(context.Context, string) (mo.Option[string], error)
	Set(context.Context, string, string, time.Duration) error
}

Jump to

Keyboard shortcuts

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