mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
update glide
This commit is contained in:
@@ -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...)
|
||||
}
|
||||
|
||||
@@ -12,6 +12,15 @@ import (
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
const (
|
||||
// TypeNone ...
|
||||
TypeNone = ""
|
||||
// TypeSync ...
|
||||
TypeSync = "sync"
|
||||
// TypeAsync ...
|
||||
TypeAsync = "async"
|
||||
)
|
||||
|
||||
/*Task task
|
||||
|
||||
swagger:model Task
|
||||
|
||||
Reference in New Issue
Block a user