Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
Build returns an environment variable dictionary with an entry for each leaf containing a scalar value.
Example:
src := map[string]interface{}{
"status": map[string]interface{}{
"listeners": []map[string]interface{}{
{
"type": "secure",
"addresses": []map[string]interface{}{
{
"host": "my-cluster-kafka-bootstrap.coffeeshop.svc",
"port": "9093",
},
},
},
},
},
}
actual, _ := Build(src)
actual should contain the following values:
"STATUS_LISTENERS_0_TYPE": "secure", "STATUS_LISTENERS_0_ADDRESSES_0_HOST": "my-cluster-kafka-bootstrap.coffeeshop.svc", "STATUS_LISTENERS_0_ADDRESSES_0_PORT": "9093",
Now, consider the following example:
actual, _ = Build(src, "kafka")
actual should contain the following values instead:
"KAFKA_STATUS_LISTENERS_0_TYPE": "secure", "KAFKA_STATUS_LISTENERS_0_ADDRESSES_0_HOST": "my-cluster-kafka-bootstrap.coffeeshop.svc", "KAFKA_STATUS_LISTENERS_0_ADDRESSES_0_PORT": "9093",
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.