https://github.com/lyf-coder/entity
Go json access like viper
https://github.com/lyf-coder/entity
entity go golang json
Last synced: 6 months ago
JSON representation
Go json access like viper
- Host: GitHub
- URL: https://github.com/lyf-coder/entity
- Owner: lyf-coder
- License: mit
- Created: 2020-02-08T02:43:41.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-16T10:12:19.000Z (over 6 years ago)
- Last Synced: 2025-08-15T05:58:37.343Z (11 months ago)
- Topics: entity, go, golang, json
- Language: Go
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# entity
Go json access like [viper](https://github.com/spf13/viper)
[](https://github.com/lyf-coder/entity)
[](https://godoc.org/github.com/lyf-coder/entity)
[](https://goreportcard.com/report/github.com/lyf-coder/entity)
## Install
```console
go get github.com/lyf-coder/entity
```
## Usage
import (
"github.com/lyf-coder/entity"
)
// json string
jsonStr := `{"IP": "127.0.0.1", "admin": {"name":"jack"}}`
// json string to []byte
b := []byte(jsonStr)
// new entity
entity := entity.NewByJSON(b)
// Usage
entity.GetString("IP") // "127.0.0.1"
entity.GetString("admin:name") // "jack"