Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SoftDelTypeMap = map[reflect.Type]SoftDelType{ reflect.TypeOf(DeleteTimeNil{}): DelTimeNil, reflect.TypeOf(DeleteBool{}): DelBool, reflect.TypeOf(DeleteBoolNil{}): DelBoolNil, reflect.TypeOf(DeleteUUID{}): DelUUID, reflect.TypeOf(DeleteUUIDNil{}): DelUUIDNil, reflect.TypeOf(DeleteInt32{}): DelInt32, reflect.TypeOf(DeleteInt64{}): DelInt64, reflect.TypeOf(DeleteGormSecond{}): DelGormSecond, reflect.TypeOf(DeleteGormMilli{}): DelTimeGormMilli, reflect.TypeOf(DeleteGormNano{}): DelTimeGormNano, reflect.TypeOf(DeleteGormFlag{}): DelGormFlag, } SoftDelTypeNoFVMap = map[SoftDelType]field.FValue{ DelTimeNil: {Name: "deleted_at", Type: field.Null}, DelBool: {Name: "deleted_flag", Type: field.Expression, Value: "false"}, DelBoolNil: {Name: "deleted_flag", Type: field.Null}, DelUUID: {Name: "deleted_uuid", Type: field.Val, Value: uuid.UUID{}}, DelUUIDNil: {Name: "deleted_uuid", Type: field.Null}, DelInt32: {Name: "deleted_flag", Type: field.Expression, Value: "0"}, DelInt64: {Name: "deleted_flag", Type: field.Expression, Value: "0"}, DelGormSecond: {Name: "deleted_at", Type: field.Expression, Value: "0"}, DelTimeGormMilli: {Name: "deleted_at", Type: field.Expression, Value: "0"}, DelTimeGormNano: {Name: "deleted_at", Type: field.Expression, Value: "0"}, DelGormFlag: {Name: "deleted_flag", Type: field.Expression, Value: "0"}, } SoftDelTypeYesFVMap = map[SoftDelType]field.FValue{ DelTimeNil: {Name: "deleted_at", Type: field.Now}, DelBool: {Name: "deleted_flag", Type: field.Expression, Value: "true"}, DelBoolNil: {Name: "deleted_flag", Type: field.Expression, Value: "true"}, DelUUID: {Name: "deleted_uuid", Type: field.Val, Value: types.V4()}, DelUUIDNil: {Name: "deleted_uuid", Type: field.Val, Value: types.V4()}, DelInt32: {Name: "deleted_flag", Type: field.ID}, DelInt64: {Name: "deleted_flag", Type: field.ID}, DelGormSecond: {Name: "deleted_at", Type: field.UnixSecond}, DelTimeGormMilli: {Name: "deleted_at", Type: field.UnixMilli}, DelTimeGormNano: {Name: "deleted_at", Type: field.UnixNano}, DelGormFlag: {Name: "deleted_flag", Type: field.Expression, Value: "1"}, } )
Functions ¶
This section is empty.
Types ¶
type DeleteGormFlag ¶
type DeleteGormFlag struct {
IsDel soft_delete.DeletedAt `gorm:"softDelete:flag"`
}
gorm flag软删除 未删除时,为零值,删除时,为1
type DeleteGormMilli ¶
type DeleteGormMilli struct {
DeletedAt soft_delete.DeletedAt `gorm:"softDelete:milli"`
}
gorm 毫秒软删除,储存类型为uint64 未删除时,为零值,删除时,为删除时间
type DeleteGormNano ¶
type DeleteGormNano struct {
DeletedAt soft_delete.DeletedAt `gorm:"softDelete:nano"`
}
gorm 纳秒软删除,储存类型为uint64,可储存584年 未删除时,为零值,删除时,为删除时间
type DeleteGormSecond ¶
type DeleteGormSecond struct {
DeletedAt soft_delete.DeletedAt
}
gorm 秒软删除,储存类型为uint32,可储存272年 未删除时,为零值,删除时,为删除时间
type SoftDelType ¶
type SoftDelType int
const ( None SoftDelType = iota DelTimeNil DelBool DelBoolNil DelUUID DelUUIDNil DelInt32 DelInt64 DelGormSecond DelTimeGormMilli DelTimeGormNano DelGormFlag )
Click to show internal directories.
Click to hide internal directories.