Categorygithub.com/eucatur/go-toolbox/cache
modulepackage
1.0.0
Repository: https://github.com/eucatur/go-toolbox.git
Documentation: pkg.go.dev

# README

cache

cache É um wrapper do go-cache uma lib de cache em memória com tempo de expiração, básicamente tem somente o metodo Set e Get

Exemplo

package main

import (
	"log"
	"time"

	"github.com/eucatur/go-toolbox/cache"
)

func main() {
	key := "foo"
	value := "bar"

	// The default duration in cache is 1 minute
	cache.Set(key, value)

	// Add on cache with 5 minutes
	cache.Set(key, value, 5*time.Minute)

	v, found := cache.Get(key)

	if v != nil {
		value = v.(string)
	}

	if found {
		log.Println("Found: ", value)
	}
}

# Packages

No description provided by the author

# Functions

No description provided by the author
No description provided by the author

# Variables

No description provided by the author