cachex

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

* @Author: hugo * @Date: 2024-05-30 20:22 * @LastEditors: hugo * @LastEditTime: 2024-06-12 15:07 * @FilePath: \gotox\cachex\cachex.go * @Description: * * Copyright (c) 2024 by hugo, All Rights Reserved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cachex

type Cachex struct {
	*cache.Cache
	// contains filtered or unexported fields
}

func (*Cachex) Close

func (c *Cachex) Close(ctx context.Context, wg *sync.WaitGroup)

func (*Cachex) Name

func (c *Cachex) Name() string

func (*Cachex) Set

func (c *Cachex) Set(key string, value any)

type Cachexer

type Cachexer interface {
	Name() string
	Set(key string, value any)
	Get(key string) (any, bool)
	Delete(key string)
	Flush()
	Close(ctx context.Context, wg *sync.WaitGroup)
}

func New

func New(opts ...Option) Cachexer

type Option

type Option func(*Cachex)

func WithCleanupInterval

func WithCleanupInterval(cleanupInterval time.Duration) Option

func WithExpiration

func WithExpiration(expiration time.Duration) Option

Jump to

Keyboard shortcuts

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