Socket
Socket
Sign inDemoInstall

github.com/rveen/ogdl/v2

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/rveen/ogdl/v2


Version published
Created
Source

OGDL for Go

This library is being refactored. If you depend on the stable version, import gopkg.in/rveen/ogdl.v1 instead.

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

Documentation

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

Installation

go get github.com/rveen/ogdl

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

Discussion

There is a list: ogdl-go.

Example: a configuration file

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

eth0
  ip
    192.168.1.1
  gateway
    192.168.1.10
  mask
    255.255.255.0
  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: 192.168.1.1, timeout: 20

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

FAQs

Package last updated on 01 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc