ValidateObject not in interface
This commit is contained in:
parent
336dea8147
commit
6834a79601
1
types.go
1
types.go
@ -25,7 +25,6 @@ type Database interface {
|
||||
// C(name string) Collection
|
||||
Name() string
|
||||
EnsureIndex(m ModelInterface, index ...Index) error
|
||||
ValidateObject(m ModelInterface, changes bson.M) error
|
||||
ReadDocument(m ModelInterface, selector bson.M) error
|
||||
CreateDocument(m ModelInterface) error
|
||||
ReadCollection(results interface{}, filter bson.M, selector bson.M, offset int, limit int, sort []string, pipelineModifier PipelineModifierFunction) error
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
// 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
|
||||
validator := validator.New(&validator.Config{
|
||||
TagName: "validator",
|
||||
|
Loading…
Reference in New Issue
Block a user