Go Fast Object Map based on upon Murmur3
Example 1
hashmap,_ := murmur3map.NewMap(100)
hashmap.Set("keyforstring","Sample Text Value")
val, _ := hashmap.Get("keyforstring")
fmt.Println(val.Value)
Example 2
type sampletype struct{
name string
}
func main(){
hashmap,_ := murmur3map.NewMap(100)
sampletype_instance := new(sampletype)
sampletype_instance.name = "my name is flouthoc"
hashmap.Set("keyforobject", sampletype_instance)
valtwo,_ := hashmap.Get("keyforobject")
obj2,_ := valtwo.Value.(*sampletype)
fmt.Println(obj2.name)
}
Allocates a new mumurmap with given size. Returns struct MurmurMap
Sets k-v pair in map. Keys are supposed to be strings. Values can be anything just be careful when you are fetching them back from the map , see example for usage.
Returns back the value corresponding to the specified key otherwise returns false. Just be sure to cast value back to struct type when you are done with fetching. See Example for usage.