hafezieh

package module
v0.0.0-...-8b3890d Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2017 License: MIT Imports: 2 Imported by: 0

README

Hāfezieh

Hāfezieh is a key:value cache interface, for now!

Build Status GoDoc

Usage
// TODO

Documentation

Index

Constants

View Source
const UseDefaultValue time.Duration = -1

UseDefaultValue can be used in Set, to use the default revisitDuration value by the engine

Variables

View Source
var (
	// ErrMiss is the error returned on Get, when the key is not available
	ErrMiss = errors.New("Not cached, or deleted")
	// ErrNegativeDuration is the error returned on Set, when revisitDuration<0
	ErrNegativeDuration = errors.New("revisitDuration can't be negative")
)

Functions

This section is empty.

Types

type Cache

type Cache interface {
	// Set stores x and assign it to the key, and if revisitDuration is >0
	// revisit (which is dependant on the engine) happens after revisitDuration
	// from now, unless the key is reset or deleted in the mean time.
	// Some engines may have ability to set default for revisitDuration
	Set(key string, x interface{}, revisitDuration time.Duration) error

	// Returns the assigned object to the key, if is not expired or deleted
	// by now
	Get(key string) (interface{}, error)

	// Deletes the assigned objected
	Del(key string) error

	// Close frees the resources
	Close() error
}

Cache is a simple cache interface, to rulw all the cache engunes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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