model

package
v2.0.0-...-4e8a7ef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreatedAt

type CreatedAt struct {
	CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
}

CreatedAt represents the timestamp of when an entity or object was created. It is used to track the creation time of various entities.

type DeletedAt

type DeletedAt struct {
	Deleted   bool       `gorm:"column:deleted;index:deleted" json:"deleted"`
	DeletedAt *time.Time `gorm:"column:deleted_at" json:"deleted_at"`
}

DeletedAt struct represents the soft delete functionality in GORM. It embeds the `gorm.DeletedAt` struct, which provides the necessary fields for soft deletion.

func (*DeletedAt) Delete

func (o *DeletedAt) Delete(v bool)

Delete updates the `Deleted` and `DeletedAt` fields of the `DeletedAt` object. If `v` is true, `Deleted` is set to `v` and `DeletedAt` is set to the current time. If `v` is false, `Deleted` is set to `v` and `DeletedAt` is set to `nil`.

func (*DeletedAt) IsDeleted

func (o *DeletedAt) IsDeleted() bool

IsDeleted returns true if the Deleted field of the DeletedAt object is set to true, indicating that the object has been deleted. Otherwise, it returns false.

type UpdatedAt

type UpdatedAt struct {
	UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
}

UpdatedAt represents the timestamp when an entity was last updated. It is used to keep track of the latest modification of the entity.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL