local

package
v0.0.0-...-ded851d Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package local implements cache.Cache with an in-memory cache.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache implements the cache.Cache interface.

func New

func New(size int) (*Cache, error)

New returns a new in-memory cache of the given size.

func (*Cache) Add

func (c *Cache) Add(key string)

Add implements the cache.Cache interface.

func (*Cache) Exists

func (c *Cache) Exists(key string) bool

Exists implements the cache.Cache interface.

func (*Cache) GetValue

func (c *Cache) GetValue(ctx context.Context, key string) (string, error)

func (*Cache) SetValue

func (c *Cache) SetValue(ctx context.Context, key string, value string) error

Jump to

Keyboard shortcuts

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