gomemcache

package module
v0.0.0-...-a3d7fd3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2023 License: MIT Imports: 0 Imported by: 0

README

GoMemCache

Go Report Repository Top Language GitHub go.mod Go version Github Repository Size Github Open Issues License GitHub last commit

GoMemCache is a simple in-memory cache implementation written in Go. It provides a key-value store that can be used to cache data in memory.

Installation

You can install GoMemCache by running the following command:

$ go get github.com/kovalenko-tech/gomemcache
Usage

To use GoMemCache in your Go project, import the package and create a new instance of the GoMemCache type using the New() function:

import "github.com/kovalenko-tech/gomemcache"

cache := gomemcache.New()

You can then use the following methods to interact with the cache:

`Set(key string, value interface{})`

Sets a key-value pair in the cache.

cache.Set("mykey", "myvalue")
`Get(key string) interface{}`

Retrieves the value associated with a given key from the cache.

value := cache.Get("mykey")
`Delete(key string)`

Removes a key-value pair from the cache.

cache.Delete("mykey")
License

GoMemCache is licensed under the MIT License. Feel free to use, modify, and distribute this code as you see fit.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoMemCache

type GoMemCache struct {
	// contains filtered or unexported fields
}

func New

func New() *GoMemCache

func (*GoMemCache) Delete

func (c *GoMemCache) Delete(key string)

func (*GoMemCache) Get

func (c *GoMemCache) Get(key string) interface{}

func (*GoMemCache) Set

func (c *GoMemCache) Set(key string, value interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL