create validator interface for config

This commit is contained in:
Adrien Marquès 2020-03-28 12:26:11 +01:00
parent 5f3aa5967d
commit 54705b7472
Signed by: xdrm-brackets
GPG Key ID: D75243CA236D825E
1 changed files with 5 additions and 0 deletions

View File

@ -8,6 +8,11 @@ import (
var availableHTTPMethods = []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodDelete} var availableHTTPMethods = []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodDelete}
// validator unifies the check and format routine
type validator interface {
Validate(...datatype.T) error
}
// Server represents a full server configuration // Server represents a full server configuration
type Server struct { type Server struct {
Types []datatype.T Types []datatype.T