2019-07-11 18:45:42 +02:00
|
|
|
---
|
|
|
|
title: 'encoding/yaml'
|
|
|
|
---
|
|
|
|
|
|
|
|
yaml provides functions for working with yaml data
|
2020-03-23 21:18:06 +01:00
|
|
|
|
|
|
|
## Index
|
|
|
|
|
|
|
|
|
|
|
|
* [def <b>dumps</b>(obj) string](#def-iyamlibdumpsb)
|
|
|
|
* [def <b>loads</b>(source) object](#def-iyamlibloadsb)
|
|
|
|
|
|
|
|
|
2019-07-11 18:45:42 +02:00
|
|
|
## Functions
|
|
|
|
|
|
|
|
|
2020-03-23 21:18:06 +01:00
|
|
|
#### def <i>yaml</i>.<b>dumps</b>
|
2019-07-11 18:45:42 +02:00
|
|
|
```go
|
2020-03-23 21:18:06 +01:00
|
|
|
yaml.dumps(obj) string
|
2019-07-11 18:45:42 +02:00
|
|
|
```
|
|
|
|
serialize obj to a yaml string
|
|
|
|
|
2020-03-23 21:18:06 +01:00
|
|
|
###### Arguments
|
2019-07-11 18:45:42 +02:00
|
|
|
|
|
|
|
| name | type | description |
|
|
|
|
|------|------|-------------|
|
2020-03-23 21:18:06 +01:00
|
|
|
| `obj` | `object` | input object |
|
2019-07-11 18:45:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-23 21:18:06 +01:00
|
|
|
#### def <i>yaml</i>.<b>loads</b>
|
2019-07-11 18:45:42 +02:00
|
|
|
```go
|
2020-03-23 21:18:06 +01:00
|
|
|
yaml.loads(source) object
|
2019-07-11 18:45:42 +02:00
|
|
|
```
|
|
|
|
read a source yaml string to a starlark object
|
|
|
|
|
2020-03-23 21:18:06 +01:00
|
|
|
###### Arguments
|
2019-07-11 18:45:42 +02:00
|
|
|
|
|
|
|
| name | type | description |
|
|
|
|
|------|------|-------------|
|
2020-03-23 21:18:06 +01:00
|
|
|
| `source` | `string` | input string of yaml data |
|
2019-07-11 18:45:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|