cache

package
v3.0.8-055afb8 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: Apache-2.0 Imports: 1 Imported by: 9

Documentation

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
}

func NewCache

func NewCache() *Cache

func (*Cache) Clean

func (c *Cache) Clean()

func (*Cache) Delete

func (c *Cache) Delete(k string)

func (*Cache) Get

func (c *Cache) Get(k string) (interface{}, bool)

func (*Cache) GetMustBool

func (c *Cache) GetMustBool(k string) (bool, bool)

func (*Cache) GetMustInt

func (c *Cache) GetMustInt(k string) (int, bool)

func (*Cache) GetMustString

func (c *Cache) GetMustString(k string) (string, bool)

func (*Cache) GetOrSet

func (c *Cache) GetOrSet(k string, v interface{}) (interface{}, bool)

GetOrSet returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored.

func (*Cache) Range

func (c *Cache) Range(f func(key, value interface{}) bool)

func (*Cache) Set

func (c *Cache) Set(k string, v interface{})

Jump to

Keyboard shortcuts

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