gamble

package module
v0.0.0-...-1d392f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2014 License: Apache-2.0 Imports: 6 Imported by: 1

README

Gamble (libyaml for GO)

Making the world better, one YAML parser at a time

Usage:

package main

import (
  "fmt"
	"github.com/cloudfoundry/gamble"
)

var myYAML = `
---
some_key:
- some
- items
`

func main() {
	document, err := gamble.Parse(myYAML)
	if err != nil {
	  println("Could not parse yaml")
	  return
	}

  fmt.Printf("%#v\n", document)
  // prints out a map from string to interface
  // eg:
	//    map[string]interface{}{
	//    	"some_key": []interface{}{
	//    		"some",
	//    		"items",
	//    	},
	//    }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(input interface{}) (result string, err error)

Types

type MarshalError

type MarshalError struct {
	Node interface{}
}

func (MarshalError) Error

func (err MarshalError) Error() string

type Node

type Node interface{}

func Parse

func Parse(input string) (result Node, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL