https://github.com/zerjioang/dotmap
A dot notation compatible concurrent-safe golang hashmap
https://github.com/zerjioang/dotmap
dot-notation golang json json-go
Last synced: 14 days ago
JSON representation
A dot notation compatible concurrent-safe golang hashmap
- Host: GitHub
- URL: https://github.com/zerjioang/dotmap
- Owner: zerjioang
- License: gpl-3.0
- Created: 2020-05-12T12:09:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-10-22T15:00:54.000Z (over 4 years ago)
- Last Synced: 2024-06-20T07:56:57.373Z (over 1 year ago)
- Topics: dot-notation, golang, json, json-go
- Language: Go
- Homepage: https://www.buymeacoffee.com/zerjioang
- Size: 523 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
dotmap
A Dot notation compatible concurrent safe Hashmap in pure Go
## Latest release
[**Download**](https://github.com/zerjioang/dotmap/releases)
## TL;DR
```go
package main
import (
"fmt"
"github.com/zerjioang/dotmap"
)
func main(){
mm := dotmap.New()
mm.Reset(map[string]interface{}{
"foo": "bar",
"enableDebug": false,
"version": 1.0,
"config": map[string]interface{}{
"http": 2,
},
})
v, found := dotmap.GetDotMap(mm, "config.http")
fmt.Println("key found: ", found)
fmt.Println("key value: ", v)
v2, found2 := dotmap.GetDotMap(mm, "config.key")
fmt.Println("key found: ", found2)
fmt.Println("key value: ", v2)
}
```
and prints in terminal std out:
```bash
key found: true
key value: 2
key found: false
key value:
```
## Licenses
All rights reserved to @zerjioang under GNU GPL v3 license
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Uses GPLv3 license described below
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.