Skip to content
/ parser Public

Use to parse data. As well as, it reads file and parse data. Commonly use to read config file, messages etc in application.

License

Notifications You must be signed in to change notification settings

go-rs/parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data parser

Use to parse data. As well as, it reads file and parse data. Commonly use to read config file, messages etc in application.

JSON

How to use?

  • Can load data in bytes using .Load(data)
  • Can load data from file using .LoadFile(path)
var config parser.JSON

_ = config.LoadFile("examples/config.json")

Available methods

  • Get
  • GetString
  • GetInt
  • GetFloat
  • GetBool
  • GetTime
  • GetDuration

Can get data from inner object/array too. Use dot(.) to join keys.

Example

// JSON
{
  "test": 1,
  "outer": [{
    "inner": "Hello World",
    "bool": false
  }]
}

// Get
config.GetString("outer.0.inner")

About

Use to parse data. As well as, it reads file and parse data. Commonly use to read config file, messages etc in application.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages