99 "gopkg.in/yaml.v2"
1010)
1111
12- // YamlToJson takes an input yaml string, parses it and returns a string formatted as json.
13- func YamlToJson (bytes []byte ) (string , error ) {
12+ // YamlToJSON takes an input yaml string, parses it and returns a string formatted as json.
13+ func YamlToJSON (bytes []byte ) (string , error ) {
1414 var anomaly map [string ]string
1515
1616 if err := yaml .Unmarshal (bytes , & anomaly ); err != nil {
@@ -39,6 +39,7 @@ func ParseConfig(res *http.Response) (*Config, error) {
3939 return & config , err
4040}
4141
42+ // ParseDomain returns the domain field from the bytes of a build hook response.
4243func ParseDomain (bytes []byte ) (string , error ) {
4344 var hook BuildHookResponse
4445 if err := json .Unmarshal (bytes , & hook ); err != nil {
@@ -56,6 +57,7 @@ func ParseDomain(bytes []byte) (string, error) {
5657 return hook .Domains [0 ], nil
5758}
5859
60+ // ParseReleaseVersion returns the version field from the bytes of a build hook response.
5961func ParseReleaseVersion (bytes []byte ) (int , error ) {
6062 var hook BuildHookResponse
6163 if err := json .Unmarshal (bytes , & hook ); err != nil {
@@ -69,9 +71,10 @@ func ParseReleaseVersion(bytes []byte) (int, error) {
6971 return hook .Release ["version" ], nil
7072}
7173
74+ // GetDefaultType returns the default process types given a YAML byte array.
7275func GetDefaultType (bytes []byte ) (string , error ) {
7376 type YamlTypeMap struct {
74- DefaultProcessTypes ProcessType `default_process_types`
77+ DefaultProcessTypes ProcessType `yaml:" default_process_types" `
7578 }
7679
7780 var p YamlTypeMap
@@ -93,6 +96,7 @@ func GetDefaultType(bytes []byte) (string, error) {
9396 return string (retVal ), nil
9497}
9598
99+ // ParseControllerConfig returns configuration key/value pair strings from a config.
96100func ParseControllerConfig (bytes []byte ) ([]string , error ) {
97101 var controllerConfig Config
98102 if err := json .Unmarshal (bytes , & controllerConfig ); err != nil {
0 commit comments