Documentation ¶
Index ¶
- func NewBookModel(coll *mongo.Collection) *mgs.Model[Book, *mgs.DefaultSchema]
- 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 *Book) AfterValidate(ctx context.Context, arg *mgs.HookArg[Book]) error
- func (book *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 *Book) BeforeValidate(ctx context.Context, arg *mgs.HookArg[Book]) error
- func (book *Book) Validate(ctx context.Context, arg *mgs.HookArg[Book]) error
- type BookDoc
- type BookModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBookModel ¶
func NewBookModel(coll *mongo.Collection) *mgs.Model[Book, *mgs.DefaultSchema]
Types ¶
type Book ¶
type Book struct { Title string `json:"title" bson:"title"` Author primitive.ObjectID `json:"author" bson:"author"` Price float64 `json:"price" bson:"price"` 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 ¶
Click to show internal directories.
Click to hide internal directories.