scache

package
v0.0.0-...-14fd0b5 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package scache Created by Teocci. Author: teocci@yandex.com on 2023-Aug-12

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheInstance

type CacheInstance[T any] struct {
	// contains filtered or unexported fields
}

func (*CacheInstance[T]) GetInstance

func (ci *CacheInstance[T]) GetInstance() *SimpleCache[T]

type Entry

type Entry[T any] struct {
	Data      T
	ExpiresAt time.Time
}

type SimpleCache

type SimpleCache[T any] struct {
	// contains filtered or unexported fields
}

func GetCacheInstance

func GetCacheInstance[T any](key string) *SimpleCache[T]

func (*SimpleCache[T]) Clear

func (sc *SimpleCache[T]) Clear()

func (*SimpleCache[T]) Delete

func (sc *SimpleCache[T]) Delete(key string)

func (*SimpleCache[T]) Get

func (sc *SimpleCache[T]) Get(key string) (*T, bool)

func (*SimpleCache[T]) Has

func (sc *SimpleCache[T]) Has(key string) bool

func (*SimpleCache[T]) Set

func (sc *SimpleCache[T]) Set(key string, value T, duration time.Duration)

Jump to

Keyboard shortcuts

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