cache

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 4 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 interface {
	Put(key string, value interface{}, expire time.Duration) error

	Delete(key string) (interface{}, error)

	Get(key string) (interface{}, error)
}

func NewCache

func NewCache() Cache

type IDValueCache

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

func NewValueCache

func NewValueCache() *IDValueCache

func (*IDValueCache) Delete

func (pc *IDValueCache) Delete(value interface{}) (interface{}, error)

func (*IDValueCache) Get

func (pc *IDValueCache) Get(value interface{}) (interface{}, error)

func (*IDValueCache) Put

func (pc *IDValueCache) Put(value interface{}, expire time.Duration) error

type MapCache

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

func (*MapCache) Delete

func (m *MapCache) Delete(key string) (interface{}, error)

func (*MapCache) Get

func (m *MapCache) Get(key string) (interface{}, error)

func (*MapCache) Put

func (m *MapCache) Put(key string, value interface{}, expire time.Duration) error

Jump to

Keyboard shortcuts

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