validator not work

This commit is contained in:
mr
2024-07-19 09:36:46 +02:00
parent e838474835
commit c494dba5ab
6 changed files with 6 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ import (
"github.com/rs/zerolog"
)
var validate = validator.New(validator.WithRequiredStructEnabled())
var Validate = validator.New(validator.WithRequiredStructEnabled())
type AbstractAccessor struct {
Logger zerolog.Logger
@@ -19,10 +19,6 @@ func (dma *AbstractAccessor) GetType() string {
return dma.Type
}
func (dma *AbstractAccessor) Validate(d DBObject) error {
return validate.Struct(d)
}
func (dma *AbstractAccessor) SetLogger(t resources.ResourceType) {
dma.Logger = logs.CreateLogger(t.String(), "")
dma.Type = t.String()