Documentation ¶
Overview ¶
Example ¶
Example demonstrating the use concurrent-map.
package main import ( "log" "github.com/neptulon/cmap" ) func main() { m := cmap.New() m.Set("foo", "bar") if val, ok := m.GetOk("foo"); ok { bar := val.(string) log.Println(bar) } m.Delete("foo") }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CMap ¶
type CMap struct {
// contains filtered or unexported fields
}
CMap is a thread-safe map.
func (*CMap) Delete ¶
func (c *CMap) Delete(key interface{})
Delete removes a value for a given key.
func (*CMap) Get ¶
func (c *CMap) Get(key interface{}) (val interface{})
Get retrieves a value for a given key.
func (*CMap) GetOk ¶
GetOk retrieves a value for a given key. An 'ok' flag is also returned indicating whether a value exists for the given key.
Click to show internal directories.
Click to hide internal directories.