ValidateObject not in interface

This commit is contained in:
Sebastian Frank 2022-02-14 16:01:12 +01:00
parent 336dea8147
commit 6834a79601
Signed by: apairon
GPG Key ID: A0E05A8199CE3F57
2 changed files with 1 additions and 2 deletions

View File

@ -25,7 +25,6 @@ type Database interface {
// C(name string) Collection // C(name string) Collection
Name() string Name() string
EnsureIndex(m ModelInterface, index ...Index) error EnsureIndex(m ModelInterface, index ...Index) error
ValidateObject(m ModelInterface, changes bson.M) error
ReadDocument(m ModelInterface, selector bson.M) error ReadDocument(m ModelInterface, selector bson.M) error
CreateDocument(m ModelInterface) error CreateDocument(m ModelInterface) error
ReadCollection(results interface{}, filter bson.M, selector bson.M, offset int, limit int, sort []string, pipelineModifier PipelineModifierFunction) error ReadCollection(results interface{}, filter bson.M, selector bson.M, offset int, limit int, sort []string, pipelineModifier PipelineModifierFunction) error

View File

@ -6,7 +6,7 @@ import (
) )
// ValidateObject validates object via validator tag and custom method // ValidateObject validates object via validator tag and custom method
func (db *MgoDatabase) ValidateObject(m ModelInterface, changes bson.M) error { func ValidateObject(db Database, m ModelInterface, changes bson.M) error {
// first validate via struct tag // first validate via struct tag
validator := validator.New(&validator.Config{ validator := validator.New(&validator.Config{
TagName: "validator", TagName: "validator",