Skip to content

d1ksim/in-memory-cache-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

in-memory-cache-go

Golang tool for storing data in the system RAM

My first experience as a development package for storing data of the in-memory-cache type

Example

package main

import (
  "fmt"
  "github.com/d1mpi/in-memory-cache-go"
)

func main() {
	newCache := cache.New()
	setErr := newCache.Set("Alina", 12)
	if setErr != nil {
		fmt.Println(err)
		return
	}

	userId, getErr := newCache.Get("Alina")
	if getErr != nil {
		fmt.Println(err)
		return
	} else {
		fmt.Println(userId)
	}

	delErr := newCache.Delete("Alina")
	if delErr != nil {
		fmt.Println(err)
		return
	}

	userId = newCache.Get("Alina")
	fmt.Println(userId)
}

Install

Use go get -u github.com/d1mpi/in-memory-cache-go

About

Golang tool for storing data in the system RAM

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages