add validator to service input parameter
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Adrien Marquès 2020-03-14 16:14:04 +01:00
parent e12c52b88f
commit 511070196b
Signed by: xdrm-brackets
GPG Key ID: D75243CA236D825E
1 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,10 @@
package config
import "net/http"
import (
"net/http"
"git.xdrm.io/go/aicra/config/datatype"
)
var availableHTTPMethods = []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodDelete}
@ -10,7 +14,9 @@ type Parameter struct {
Type string `json:"type"`
Rename string `json:"name,omitempty"`
Optional bool
// Default *interface{} `json:"default"`
// validator is set from the @Type
validator datatype.Validator
}
// Service represents a service definition (from api.json)
@ -22,7 +28,6 @@ type Service struct {
Download *bool `json:"download"`
Input map[string]*Parameter `json:"in"`
// Output map[string]*Parameter `json:"out"`
}
// Services contains every service that represents a server configuration