Skip to content
OGDL for Go
Go GAP
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
gpath CallBinary, ParseFile file check
.gitignore Initial commit
LICENSE simplify license
README.md no cycles
all_test.go ParseXXX returns consistently an empty root node
binary.go Lint warnings
chars.go Lint warnings
doc.go ${} are now paths in a template. Usefull as delimiters of the variable
eval.go
event.go
expression.go Lint warnings
function.go Lint warnings
gettypes.go Lint warnings
graph.go Lint warnings
log.go Lint warnings
parser.go Lint warnings
path.go Lint warnings
productions.go Lint warnings
rfunction.go Lint warnings
schema.go cleanup
template.go

README.md

OGDL for Go

Package ogdl is used to process OGDL, the Ordered Graph Data Language.

OGDL is a textual format to write trees or graphs of text, where indentation and spaces define the structure. Here is an example:

network
  ip 192.168.1.100
  gw 192.168.1.9

The languange is simple, either in its textual representation or its number of productions (the specification rules), allowing for compact implementations.

OGDL character streams are normally formed by Unicode characters, and encoded as UTF-8 strings, but any encoding that is ASCII transparent is compatible with the specification and the implementations.

This implementation does not support cyles (OGDL Level 2).

Documentation

The documentation of the package is kindly generated by godoc.org.

Installation

go get github.com/rveen/ogdl

Discussion

Use the ogdl-go list, if necessary.

Example: a configuration file

If we have a text file 'conf.g' like this:

eth0
  ip
    192.168.1.1
  gateway
    192.168.1.10
  mask
    255.255.255.0
  timeout
    20

then,

g := ogdl.ParseFile("conf.g")
ip,_ := g.GetString("eth0.ip")
to,_ := g.GetInt("eth0.timeout")
println("ip:",ip,", timeout:",to)

will print

ip: 192.168.1.1, timeout: 20
Something went wrong with that request. Please try again.