Documentation
¶
Index ¶
Constants ¶
View Source
const (
// DeletedAtColumn is the default column name for soft deletes
DeletedAtColumn = "deleted_at"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SoftDeletes ¶
SoftDeletes provides soft delete functionality for models. Models that embed this struct will have soft delete capabilities.
func (*SoftDeletes) Delete ¶
func (sd *SoftDeletes) Delete()
Delete marks the model as deleted by setting the deleted_at timestamp.
func (*SoftDeletes) GetDeletedAt ¶
func (sd *SoftDeletes) GetDeletedAt() *time.Time
GetDeletedAt returns the deleted_at timestamp.
func (*SoftDeletes) IsDeleted ¶
func (sd *SoftDeletes) IsDeleted() bool
IsDeleted returns true if the model has been soft deleted.
func (*SoftDeletes) Restore ¶
func (sd *SoftDeletes) Restore()
Restore marks the model as not deleted by setting deleted_at to nil.
Click to show internal directories.
Click to hide internal directories.