Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct { // ID is the unique identifier of the object of the model. // It is generated automatically when the object is created. So, you cannot pass a custom value for it. // // Example: "550e8400-e29b-41d4-a716-446655440000" ID uuid.UUID `json:"id" gorm:"primaryKey;not null;type:uuid"` // CreatedAt is the time when the object was created. // It is set automatically when the object is created. // // Example: "2021-07-01T12:00:00Z" CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"` // UpdatedAt is the time when the object was last updated. // It is set automatically when the object is updated. // // Example: "2021-07-01T12:00:00Z" UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"` // DeletedAt is the time when the object was deleted. // It is set automatically when the object is marked deleted. // Generally, used for soft deletes (marking records as deleted without actually removing them from the database). // // Example: "2021-07-01T12:00:00Z" DeletedAt gorm.DeletedAt `json:"deleted_at"` }
type Record ¶
type Record struct { Base // Title of the record. // // Example: "Test Record" // // It is a required field. Title string `json:"title" gorm:"not null;check:(length(title)>0)"` // ID of the user who created the record. // // Example: "550e8400-e29b-41d4-a716-446655440000" // // It is a required field. UserID uuid.UUID `json:"user_id" gorm:"not null;type:uuid"` }
Click to show internal directories.
Click to hide internal directories.