Documentation ¶
Index ¶
- type Author
- type AuthorDoc
- type AuthorModel
- type Book
- func (book Book) AfterCreate(ctx context.Context, arg *mgs.HookArg[Book]) error
- func (book Book) AfterDelete(ctx context.Context, arg *mgs.HookArg[Book]) error
- func (book Book) AfterFind(ctx context.Context, arg *mgs.HookArg[Book]) error
- func (book Book) AfterUpdate(ctx context.Context, arg *mgs.HookArg[Book]) error
- func (Book) AfterValidate(ctx context.Context, arg *mgs.HookArg[Book]) error
- func (Book) BeforeCreate(ctx context.Context, arg *mgs.HookArg[Book]) error
- func (book Book) BeforeDelete(ctx context.Context, arg *mgs.HookArg[Book]) error
- func (book Book) BeforeFind(ctx context.Context, arg *mgs.HookArg[Book]) error
- func (book Book) BeforeUpdate(ctx context.Context, arg *mgs.HookArg[Book]) error
- func (Book) BeforeValidate(ctx context.Context, arg *mgs.HookArg[Book]) error
- func (Book) Validate(ctx context.Context, arg *mgs.HookArg[Book]) error
- type BookDoc
- type BookModel
- type Review
- type ReviewDoc
- type ReviewModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Author ¶
type AuthorModel ¶
type AuthorModel = mgs.Model[Author, *mgs.DefaultSchema]
func NewAuthorModel ¶
func NewAuthorModel(coll *mongo.Collection) *AuthorModel
type Book ¶
type Book struct { Title string `json:"title" bson:"title"` // ObjectID or Author Object Author interface{} `json:"author" bson:"author"` Reviews []interface{} `json:"chapters" bson:"chapters"` Deleted bool `json:"-" bson:"deleted"` DeletedAt *time.Time `json:"-" bson:"deletedAt"` }
func (Book) AfterCreate ¶
func (Book) AfterDelete ¶
func (Book) AfterUpdate ¶
func (Book) AfterValidate ¶
func (Book) BeforeCreate ¶
func (Book) BeforeDelete ¶
func (Book) BeforeFind ¶
func (Book) BeforeUpdate ¶
func (Book) BeforeValidate ¶
type BookModel ¶
type BookModel = mgs.Model[Book, *mgs.DefaultSchema]
func NewBookModel ¶
func NewBookModel(coll *mongo.Collection) *BookModel
type Review ¶
type ReviewModel ¶
type ReviewModel = mgs.Model[Review, *mgs.DefaultSchema]
func NewReviewModel ¶
func NewReviewModel(coll *mongo.Collection) *ReviewModel
Click to show internal directories.
Click to hide internal directories.