cache

package
v0.0.0-...-b0fec18 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[T any] interface {
	Set(key string, value T)
	Get(key string) (T, bool)
}

type MapCache

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

func NewMapCache

func NewMapCache[T any](capacity int) *MapCache[T]

func (*MapCache[T]) Get

func (c *MapCache[T]) Get(key string) (T, bool)

func (*MapCache[T]) Set

func (c *MapCache[T]) Set(key string, value T)

type SliceCache

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

func NewSliceCache

func NewSliceCache[T any](capacity int) *SliceCache[T]

func (*SliceCache[T]) Get

func (c *SliceCache[T]) Get(key string) (T, bool)

func (*SliceCache[T]) Set

func (c *SliceCache[T]) Set(key string, value T)

Jump to

Keyboard shortcuts

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