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 gw

The language 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).


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


go get github.com/rveen/ogdl

go get gopkg.in/rveen/ogdl.v1 (for the previous -stable- version)


There is a list: ogdl-go.

Example: a configuration file

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

eth0 ip gateway mask timeout 20 then,

g := ogdl.FromFile("conf.ogdl") ip := g.Get("eth0.ip").String() to := g.Get("eth0.timeout").Int64(60) println("ip:",ip,", timeout:",to)

will print

ip:, timeout: 20

If the timeout parameter were not present, then the default value (60) will be assigned to 'to'.

MD5 signature: e076e5d276c1a03960498199b580b2b6