Skip to content

solutionstack/lcache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lcache

Cache library for golang. It supports LFU currently.

Features

  • Supports LFU.

  • Goroutine safe.

Install

$ go get github.com/solutionstack/lcache

Example

Set a key-value pair.

package main

import (
  "github.com/solutionstack/lcache"
  "fmt"
)

func main() {
  lc := lcache.NewCache(20) //optional size parameter to NewCache
  lc.Write("key", "ok")
  
  result := lc.Read("key")
  
  if  result.Error != nil {
    panic( result.Error  )
  }
  fmt.Println("Read:", result.Value)
}

Author

Olubodn Agbalaya

About

A simple LRU based cache in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy