Parser written in Golang for a simple key value access language.
I have created a modest specification for a key value access langauge. It allows for input and access of values to a key value store such as Golang's BoltDB.
The language specification: https://github.com/kval-access-language/KVAL
Import the library and run the Parse function() e.g:
var query "GET Bucket One >> Bucket Two >>>> Requested Key"
kq, err := kvalparse.Parse(query)
if err != nil {
return kr, err
}
If we find an error we have an invalid query. Results are returned in a query structure:
type KQUERY struct {
Function Token
Buckets []string
Key string
Value string
Newname string
Regex bool
}
GPL Version 3: https://github.com/kval-access-language/KVAL-BoltDB/blob/master/LICENSE