Categorygithub.com/kval-access-language/kval-parse
modulepackage
0.0.0-20170504112528-b96aa5a26330
Repository: https://github.com/kval-access-language/kval-parse.git
Documentation: pkg.go.dev

# README

KVAL-Parse

Build Status GoDoc Go Report Card

Parser written in Golang for a simple key value access language.

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

Usage

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
}

License

GPL Version 3: https://github.com/kval-access-language/KVAL-BoltDB/blob/master/LICENSE

# Functions

Parse is the only function that a binding should care about.
Version will return an indication of which version of the KVAL language we are working from and the version of the library that you are implementing from.

# Structs

KQuery struct used to breakdown a query string in a way that can be utilised by the calling code more easily.