-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Refactor model hook and integrate ModelHook across operations. #54
feat: - hook: adjust the implementation of the model hook to handle the default parameters and check if the corresponding interface is implemented based on either the default parameters or the `modelHook` parameter. - operation: add the ModelHook field to the OpContext struct. - finder: - add the ModelHook method to set the modelHook value. - add the ModelHook field to the OpContext struct. - when creating an instance of the operation.OpContext struct and the OpContext struct, pass the ModelHook object. - creator: - add the ModelHook method to set the modelHook value. - add the ModelHook field to the OpContext struct. - when creating an instance of the operation.OpContext struct and the OpContext struct, pass the ModelHook object. - deleter: - add the ModelHook method to set the modelHook value. - add the ModelHook field to the OpContext struct. - when creating an instance of the operation.OpContext struct and the OpContext struct, pass the ModelHook object. - updater: - add the ModelHook method to set the modelHook value. - add the ModelHook field to the OpContext struct. - when creating an instance of the operation.OpContext struct and the OpContext struct, pass the ModelHook object.
- Loading branch information
1 parent
b7e200a
commit 206e1d3
Showing
17 changed files
with
246 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ type OpContext[T any] struct { | |
Doc *T | ||
Docs []*T | ||
MongoOptions any | ||
ModelHook any | ||
} | ||
|
||
type ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.