Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
log
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Build Status Code Coverage Go Report Card GolangCI Go Doc

golibs

This repository contains several useful functions and interfaces for Go:

  • Cache - in-memory cache with LRU, limits and statistics
  • Log - logger with configurable log-level on top of standard "log"
  • File:
    • safe file writing
  • JSON:
    • JSON format helper functions
  • Utils:
    • hostname validator

Cache

A quick example:

conf := cache.Config{}
conf.EnableLRU = true
c := cache.New(conf)
c.Set([]byte("key"), []byte("value"))
val := c.Get([]byte("key"))
You can’t perform that action at this time.