Skip to content
This repository was archived by the owner on Oct 29, 2019. It is now read-only.

dawidd6/go-mmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mmap

Build Status GoDoc

Package mmap implements a concurrent-safe map.

Simply the basic operations on maps but guarded with RWMutex.

Example

package main

import (
    "fmt"
    "github.com/dawidd6/go-mmap"
)

func main() {
    m := mmap.New()

    m.Set("key", "value")

    fmt.Println(m.Has("key")) // true
    fmt.Println(m.Get("key")) // value
    fmt.Println(m.Count()) // 1
    fmt.Println(m.Items()) // [value]

    m.Iterate(func(key interface{}, value interface{}) {
        fmt.Println(key, value) // key value
    })

    m.Remove("key")
}

About

📦 Concurrent-safe map[interface{}]interface{}

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages