top
(README.md)
[![Build Status](https://travis-ci.org/cloudfoundry-incubator/candiedyaml.svg)](https://travis-ci.org/cloudfoundry-incubator/candiedyaml)
[![GoDoc](https://godoc.org/github.com/cloudfoundry-incubator/candiedyaml?status.svg)](https://godoc.org/github.com/cloudfoundry-incubator/candiedyaml)


candiedyaml
===========

YAML for Go

A YAML 1.1 parser with support for YAML 1.2 features

Usage
-----

```go
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)
  }
  defer file.Close()

  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)
  }
  defer fileToWrite.Close()

  encoder := candiedyaml.NewEncoder(fileToWrite)
  err = encoder.Encode(document)

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

Imported by 181 package(s)

  1. code.cloudfoundry.org/buildpackapplifecycle/buildpackrunner
  2. code.cloudfoundry.org/buildpackapplifecycle/launcher
  3. code.cloudfoundry.org/inigo/world
  4. github.com/ArthurHlt/cli-plugin-repo/parser
  5. github.com/Azure/azure-docker-extension
  6. github.com/Bennell/cf-redis-broker/agentconfig
  7. github.com/Bennell/cf-redis-broker/brokerconfig
  8. github.com/BnLCr/os/cmd/cloudinit
  9. github.com/BnLCr/os/cmd/control
  10. github.com/BnLCr/os/compose
  11. github.com/BnLCr/os/config
  12. github.com/BnLCr/os/util
  13. github.com/Bo0mer/enslaver/config
  14. github.com/Bo0mer/os-agent/config
  15. github.com/BrianMMcClain/gorouter/config
  16. github.com/DanLavine/gorouter/config
  17. github.com/Dhilip-Kumar-S/bosh-micro-cli/deployment
  18. github.com/Dhilip-Kumar-S/bosh-micro-cli/release
  19. github.com/Dhilip-Kumar-S/bosh-micro-cli/stemcell
  20. github.com/Dhilip-Kumar-S/bosh-micro-cli/testutils
  21. github.com/JamesClonk/cli-plugin-repo/parser
  22. github.com/RedisLabs/cf-redislabs-broker/redislabs/config
  23. github.com/absourdnoise/libcompose/config
  24. github.com/absourdnoise/libcompose/utils
  25. github.com/adrianco/spigo/compose
  26. github.com/ahmetalpbalkan/azure-docker-extension
  27. github.com/allencloud/libcompose/project
  28. github.com/allencloud/libcompose/utils
  29. github.com/andrelucas/os/compose
  30. github.com/andrelucas/os/config
  31. github.com/andrelucas/os/util
  32. github.com/arschles/cf-redislabs-broker/redislabs/config
  33. github.com/benlaplanche/cf-basic-auth-route-service/servicebroker/config
  34. github.com/benlaplanche/cli-plugin-repo/parser
  35. github.com/bingosummer/azure-docker-extension
  36. github.com/bluemixgaragelondon/cli-plugin-repo/parser
  37. github.com/brahmaroutu/cli/src/cf/manifest
  38. github.com/brianmmcclain/gorouter/config
  39. github.com/caseyhadden/gorouter/config
  40. github.com/cloudfoundry-community/brooklyn-plugin/io
  41. github.com/cloudfoundry-incubator/asg-creator/config
  42. github.com/cloudfoundry-incubator/brooklyn-plugin/io
  43. github.com/cloudfoundry-incubator/buildpack_app_lifecycle/buildpackrunner
  44. github.com/cloudfoundry-incubator/buildpack_app_lifecycle/launcher
  45. github.com/cloudfoundry-incubator/inigo/world
  46. github.com/cloudfoundry-incubator/linux-circus/buildpackrunner
  47. github.com/cloudfoundry-incubator/spiff
  48. github.com/cloudfoundry-incubator/spiff/yaml
  49. github.com/cloudfoundry/buildpackapplifecycle/buildpackrunner
  50. github.com/cloudfoundry/buildpackapplifecycle/launcher
  51. github.com/cloudfoundry/inigo/world
  52. github.com/compozed/deployadactyl/config
  53. github.com/compozed/deployadactyl/controller/deployer/manifestro
  54. github.com/concourse/turbine/resource
  55. github.com/contraband/anderson
  56. github.com/cppforlife/bosh-hub/ui/job
  57. github.com/cppforlife/bosh-provisioner/deployment/manifest
  58. github.com/cppforlife/bosh-provisioner/release/job/manifest
  59. github.com/cppforlife/bosh-provisioner/release/manifest
  60. github.com/crafet/gorouter/config
  61. github.com/csterwa/cli-plugin-repo/parser
  62. github.com/danhigham/cli-plugin-repo/parser
  63. github.com/danlavine/gorouter/config
  64. github.com/datawolf/libcompose/project
  65. github.com/datawolf/libcompose/utils
  66. github.com/datawolf/os/compose
  67. github.com/datawolf/os/config
  68. github.com/datawolf/os/util
  69. github.com/davidehringer/cli-plugin-repo/parser
  70. github.com/ddimitrow/os-agent/config
  71. github.com/dinp/gorouter/config
  72. github.com/drnic/bosh-init/deployment/manifest
  73. github.com/drnic/bosh-init/deployment/stemcell
  74. github.com/drnic/bosh-init/installation/manifest
  75. github.com/drnic/bosh-init/release
  76. github.com/drnic/bosh-init/release/set/manifest
  77. github.com/drnic/bosh-init/templatescompiler/fakes
  78. github.com/drnic/bosh-init/testutils
  79. github.com/dustinrc/libcompose/config
  80. github.com/dustinrc/libcompose/utils
  81. github.com/euforic/yaml
  82. github.com/fraenkel/spiff
  83. github.com/fraenkel/spiff/yaml
  84. github.com/frapposelli/anderson
  85. github.com/geofffranks/cli-plugin-repo/parser
  86. github.com/geofffranks/spiff
  87. github.com/geofffranks/spiff/yaml
  88. github.com/ghodss/yaml
  89. github.com/gondor/libcompose/project
  90. github.com/gondor/libcompose/utils
  91. github.com/google/googet
  92. github.com/goonzoid/anderson
  93. github.com/guidowb/cli-plugin-repo/parser
  94. github.com/hatofmonkeys/cloudfocker/config
  95. github.com/hyperhq/libcompose/config
  96. github.com/hyperhq/libcompose/utils
  97. github.com/imikushin/trash/conf
  98. github.com/jberkhahn/cli-plugin-repo/parser
  99. github.com/jeaniejung/cli-plugin-repo/parser
  100. github.com/jfmyers9/spiff
  101. github.com/jfmyers9/spiff/yaml
  102. github.com/jhunt/cli-plugin-repo/parser
  103. github.com/joek/gorouter/config
  104. github.com/jtuchscherer/cli-plugin-repo/parser
  105. github.com/julz/gorouter/config
  106. github.com/kanosaki/iwalk
  107. github.com/kanosaki/picwall
  108. github.com/longnguyen11288/cli-plugin-repo/parser
  109. github.com/lynxbat/gorouter/config
  110. github.com/matthewmcnew/gorouter/config
  111. github.com/mgazz/ila/config
  112. github.com/miqui/azure-docker-extension
  113. github.com/mmb/boosh
  114. github.com/moriyoshi/devproxy
  115. github.com/negz/secret-volume/secrets
  116. github.com/pivotal-cf/cf-rabbitmq-broker
  117. github.com/pivotal-cf/cf-redis-broker/agentconfig
  118. github.com/pivotal-cf/cf-redis-broker/brokerconfig
  119. github.com/pivotal-cf/cf-redis-broker/instance/backup
  120. github.com/pivotal-cf/cf-redis-broker/restoreconfig
  121. github.com/rakutentech/bosh-init/config
  122. github.com/rakutentech/bosh-init/release
  123. github.com/rakutentech/bosh-init/stemcell
  124. github.com/rakutentech/bosh-init/testutils
  125. github.com/rakutentech/gorouter/config
  126. github.com/rancher/os/cmd/cloudinitsave
  127. github.com/rancher/os/cmd/control
  128. github.com/rancher/os/compose
  129. github.com/rancher/os/config
  130. github.com/rancher/os/util
  131. github.com/rancher/os/util/network
  132. github.com/rancher/trash/conf
  133. github.com/rancherio/os/cmd/control
  134. github.com/rancherio/os/compose
  135. github.com/rancherio/os/config
  136. github.com/rancherio/os/util
  137. github.com/ritesh0919/gorouter/config
  138. github.com/robertgmoss/cli-plugin-repo/parser
  139. github.com/robvanmieghem/libcompose/project
  140. github.com/robvanmieghem/libcompose/utils
  141. github.com/rosenhouse/bosh-bootloader/bosh
  142. github.com/rosenhouse/bosh-bootloader/boshinit
  143. github.com/rosenhouse/gomegamatchers
  144. github.com/shashankmjain/gorouter/config
  145. github.com/shashidharatd/cli/cf/manifest
  146. github.com/shashidharatd/gorouter/config
  147. github.com/shin-/libcompose/project
  148. github.com/shin-/libcompose/utils
  149. github.com/shutej/spiff/yaml
  150. github.com/skippbox/kompose/utils
  151. github.com/sklevenz/spiff
  152. github.com/sklevenz/spiff/dynaml
  153. github.com/sklevenz/spiff/yaml
  154. github.com/sneal/boshdelta/boshdelta
  155. github.com/soutenniza/cli-plugin-repo/parser
  156. github.com/starkandwayne/cf-cli-plugin-repo/parser
  157. github.com/starkandwayne/cf-cli/cf/manifest
  158. github.com/supiyun/gorouter/config
  159. github.com/swisscom/consul-release/src/acceptance-tests/helpers
  160. github.com/swisscom/spiff
  161. github.com/swisscom/spiff/yaml
  162. github.com/tcnksm/cli-plugin-repo/parser
  163. github.com/timperman/libcompose/config
  164. github.com/timperman/libcompose/utils
  165. github.com/uniseraph/libcompose/config
  166. github.com/uniseraph/libcompose/utils
  167. github.com/vito/boosh
  168. github.com/vito/spiff/yaml
  169. github.com/voelzmo/bosh-hub/ui/job
  170. github.com/voelzmo/gorouter/config
  171. github.com/wfernandes/gorouter/config
  172. github.com/wulonghui/gorouter/config
  173. github.com/xchapter7x/cli-plugin-repo/parser
  174. github.com/xiwenc/cli-plugin-repo/parser
  175. github.com/xoebus/anderson
  176. github.com/xoebus/cli-plugin-repo/parser
  177. github.com/xozrc/libcompose/config
  178. github.com/xozrc/libcompose/utils
  179. github.com/zengbo/gorouter/config
  180. github.com/zhangwei1234/docker-builder/config
  181. github.com/zhangwei1234/docker-scheduler/config

Imported only in test by 41 package(s)

  1. github.com/Bennell/cf-redis-broker/agentintegration
  2. github.com/DanLavine/gorouter
  3. github.com/Samze/cf-blue-green-deploy
  4. github.com/absourdnoise/libcompose/yaml
  5. github.com/amitkgupta/runtime-schema/models
  6. github.com/archgrove/cf-blue-green-deploy
  7. github.com/bluemixgaragelondon/cf-blue-green-deploy
  8. github.com/caseyhadden/gorouter
  9. github.com/cloudfoundry-incubator/asg-creator/iptools
  10. github.com/cloudfoundry-incubator/spiff/flow
  11. github.com/crafet/gorouter
  12. github.com/danlavine/gorouter
  13. github.com/dustinrc/libcompose/yaml
  14. github.com/fraenkel/spiff/flow
  15. github.com/geofffranks/spiff/flow
  16. github.com/gerhard/cf-blue-green-deploy
  17. github.com/hyperhq/libcompose/yaml
  18. github.com/jfmyers9/spiff/flow
  19. github.com/joek/gorouter
  20. github.com/julz/gorouter
  21. github.com/lynxbat/gorouter
  22. github.com/matthewmcnew/gorouter
  23. github.com/pivotal-cf/cf-redis-broker/agentintegration
  24. github.com/qinguoan/vulcan/router
  25. github.com/rakutentech/gorouter
  26. github.com/ritesh0919/gorouter
  27. github.com/samze/cf-blue-green-deploy
  28. github.com/shashankmjain/gorouter
  29. github.com/shashidharatd/gorouter
  30. github.com/shutej/spiff/flow
  31. github.com/sklevenz/spiff/flow
  32. github.com/supiyun/gorouter
  33. github.com/swisscom/spiff/flow
  34. github.com/timperman/libcompose/yaml
  35. github.com/uniseraph/libcompose/yaml
  36. github.com/vito/spiff/flow
  37. github.com/voelzmo/gorouter
  38. github.com/wfernandes/gorouter
  39. github.com/wulonghui/gorouter
  40. github.com/xozrc/libcompose/yaml
  41. github.com/zengbo/gorouter

Test imports 2 package(s)

  1. github.com/onsi/ginkgo
  2. github.com/onsi/gomega