azure-docker-extension/vendor/github.com/cloudfoundry-incubator/candiedyaml
Ahmet Alp Balkan 58e218e715 Override docker-compose timeout for big images
- Add explicit docker-compose pull timeouts (15 min) through env
  vars.
- Move to cloudfoundry-incubator/candiedyaml from go-yaml/yaml.v2
2015-10-15 02:40:13 +00:00
..
fixtures/specification Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
.gitignore Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
.travis.yml Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
LICENSE Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
README.md Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
api.go Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
decode.go Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
emitter.go Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
encode.go Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
libyaml-LICENSE Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
parser.go Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
reader.go Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
resolver.go Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
run_parser.go Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
scanner.go Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
tags.go Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
writer.go Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
yaml_definesh.go Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
yaml_privateh.go Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00
yamlh.go Override docker-compose timeout for big images 2015-10-15 02:40:13 +00:00

README.md

Build Status

candiedyaml

YAML for Go

A YAML 1.1 parser with support for YAML 1.2 features

Usage

package myApp

import (
  "github.com/cloudfoundry-incubator/candiedyaml"
  "fmt"
  "os"
)

func main() {
  file, err := os.Open("path/to/some/file.yml")
  if err != nil {
    println("File does not exist:", err.Error())
    os.Exit(1)
  }
  
  document := new(interface{})
  decoder := candiedyaml.NewDecoder(file)
  err = decoder.Decode(document)
  
  if err != nil {
    println("Failed to decode document:", err.Error())
  }
  
  println("parsed yml into interface:", fmt.Sprintf("%#v", document))
  
  fileToWrite, err := os.Create("path/to/some/new/file.yml")
  if err != nil {
    println("Failed to open file for writing:", err.Error())
    os.Exit(1)
  }
  
  encoder := candiedyaml.NewEncoder(fileToWrite)
  err = encoder.Encode(document)

  if err != nil {
    println("Failed to encode document:", err.Error())
    os.Exit(1)
  }
  
  return
}