cache

package
v0.0.0-...-c02b23a Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: MIT Imports: 3 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 {
	Add(key string, value interface{}, ttl time.Duration, returnChan chan *Item) error
	Pop(key string) (*Item, error)
	Get(key string) (*Item, error)

	// When a Item is deleted the go routine handling the removal is still
	// going on for n more seconds. Might need a kill signal to end it.
	Delete(key string) error
}

Cache interface

func New

func New() Cache

New creates a cache and returns the implementation

type Item

type Item struct {
	Key   string
	Value interface{}

	ReturnChan chan *Item
	// contains filtered or unexported fields
}

Item stored in Cache

Jump to

Keyboard shortcuts

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