update glide

This commit is contained in:
Seif Lotfy
2016-09-25 22:31:06 +02:00
parent 92df53b144
commit 54f66c7b09
7 changed files with 61 additions and 44 deletions

View File

@@ -2,7 +2,6 @@ package models
import (
"errors"
"fmt"
"net/http"
"path"
@@ -64,16 +63,14 @@ func (r *Route) Validate() error {
res = append(res, ErrRoutesValidationInvalidPath)
}
if r.Type == "" {
r.Type = "sync"
if r.Type == TypeNone {
r.Type = TypeSync
}
if r.Type != "async" && r.Type != "sync" {
if r.Type != TypeAsync && r.Type != TypeSync {
res = append(res, ErrRoutesValidationInvalidType)
}
fmt.Println(">>>", r.Type)
if len(res) > 0 {
return apiErrors.CompositeValidationError(res...)
}

View File

@@ -12,6 +12,15 @@ import (
"github.com/go-openapi/validate"
)
const (
// TypeNone ...
TypeNone = ""
// TypeSync ...
TypeSync = "sync"
// TypeAsync ...
TypeAsync = "async"
)
/*Task task
swagger:model Task