From 54705b747276a4a6e74f5e27496c2c1c88b9dd1f Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sat, 28 Mar 2020 12:26:11 +0100 Subject: [PATCH] create validator interface for config --- internal/config/types.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/config/types.go b/internal/config/types.go index 25be16b..4b356a5 100644 --- a/internal/config/types.go +++ b/internal/config/types.go @@ -8,6 +8,11 @@ import ( 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 type Server struct { Types []datatype.T