Skip to content

The Simple TTL Cache is an in memory cache with a set expiration time (TTL).

Notifications You must be signed in to change notification settings

DevGuyOps/simple-ttl-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Simple TTL Cache

The Simple TTL Cache is an in memory cache with a set expiration time (TTL).

Usage

package main

import (
	"time"

	simplettlcache "github.com/GuySWatson/simple-ttl-cache"
)

func main() {
	// Setup
	simpleTTLCache := simplettlcache.SimpleTTLCache{}
	simpleTTLCache.Init(time.Second * 3)

	// Put object into cache
	simpleTTLCache.Put("color", "red")

	// Get object out of cache
	simpleTTLCache.Get("color")

	// Update object in the cache
	simpleTTLCache.Update("color", 1234)
}

About

The Simple TTL Cache is an in memory cache with a set expiration time (TTL).

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages