apply/make Travis's json-format branch prototype to work with latest restructured master; added StatusCode to JSONOutput server-function contract

This commit is contained in:
amykang2020
2017-09-07 02:00:22 -07:00
committed by Denis Makogon
parent b8d7154747
commit b6b9b55ca9
10 changed files with 250 additions and 19 deletions

View File

@@ -18,6 +18,8 @@ const (
FormatDefault = "default"
// FormatHTTP ...
FormatHTTP = "http"
// FormatJSON ...
FormatJSON = "json"
)
var possibleStatuses = [...]string{"delayed", "queued", "running", "success", "error", "cancelled"}

View File

@@ -95,7 +95,7 @@ func (r *Route) Validate() error {
return ErrRoutesInvalidType
}
if r.Format != FormatDefault && r.Format != FormatHTTP {
if r.Format != FormatDefault && r.Format != FormatHTTP && r.Format != FormatJSON {
return ErrRoutesInvalidFormat
}