Documentation
¶
Index ¶
- Constants
- Variables
- type ID
- type Model
- type UIntID
- type UIntModel
- type UIntModelWithTimestamps
- type UUID
- func (id UUID) ClockSequence() int
- func (id UUID) GormDBDataType(db *gorm.DB, _ *schema.Field) string
- func (id UUID) GormValue(_ context.Context, db *gorm.DB) clause.Expr
- func (id UUID) IsNil() bool
- func (id UUID) MarshalBinary() ([]byte, error)
- func (id UUID) MarshalText() ([]byte, error)
- func (id *UUID) Scan(src interface{}) error
- func (id UUID) String() string
- func (id UUID) Time() uuid.Time
- func (id UUID) URN() string
- func (id *UUID) UnmarshalBinary(data []byte) error
- func (id *UUID) UnmarshalText(data []byte) error
- func (id UUID) Value() (driver.Value, error)
- func (id UUID) Variant() uuid.Variant
- func (id UUID) Version() uuid.Version
- type UUIDModel
- type UUIDModelWithTimestamps
Constants ¶
const NilUIntID = 0
Variables ¶
var NilUUID = UUID(uuid.Nil)
Functions ¶
This section is empty.
Types ¶
type UIntModel ¶
type UIntModel struct {
ID UIntID `gorm:"primarykey;not null"`
}
Base Model for cql with uint as id
Every model intended to be saved in the database must embed UUIDModel, UUIDModelWithTimestamps, UIntModel or UIntModelWithTimestamps reference: https://gorm.io/docs/models.html#gorm-Model
func (UIntModel) SoftDeleteColumnName ¶ added in v0.6.0
func (UIntModel) UpdatedAtColumnName ¶ added in v0.6.0
type UIntModelWithTimestamps ¶ added in v0.6.0
type UIntModelWithTimestamps struct {
ID UIntID `gorm:"primarykey;not null"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
}
Base Model for cql with uint as id and timestamps for creation, edition and deletion (soft-delete)
Every model intended to be saved in the database must embed UUIDModel, UUIDModelWithTimestamps, UIntModel or UIntModelWithTimestamps reference: https://gorm.io/docs/models.html#gorm-Model
func (UIntModelWithTimestamps) IsLoaded ¶ added in v0.6.0
func (model UIntModelWithTimestamps) IsLoaded() bool
func (UIntModelWithTimestamps) SoftDeleteColumnName ¶ added in v0.6.0
func (model UIntModelWithTimestamps) SoftDeleteColumnName() string
func (UIntModelWithTimestamps) UpdatedAtColumnName ¶ added in v0.6.0
func (model UIntModelWithTimestamps) UpdatedAtColumnName() string
type UUID ¶
func (UUID) ClockSequence ¶
func (UUID) MarshalBinary ¶
func (UUID) MarshalText ¶
func (*UUID) UnmarshalBinary ¶
func (*UUID) UnmarshalText ¶
type UUIDModel ¶
type UUIDModel struct {
ID UUID `gorm:"primarykey;not null"`
}
Base Model for cql with uuid as id and timestamps for creation, edition and deletion (soft-delete)
Every model intended to be saved in the database must embed UUIDModel, UUIDModelWithTimestamps, UIntModel or UIntModelWithTimestamps reference: https://gorm.io/docs/models.html#gorm-Model
func (UUIDModel) SoftDeleteColumnName ¶ added in v0.6.0
func (UUIDModel) UpdatedAtColumnName ¶ added in v0.6.0
type UUIDModelWithTimestamps ¶ added in v0.6.0
type UUIDModelWithTimestamps struct {
ID UUID `gorm:"primarykey;not null"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
}
Base Model for cql with uuid as id and timestamps for creation, edition and deletion (soft-delete)
Every model intended to be saved in the database must embed UUIDModel, UUIDModelWithTimestamps, UIntModel or UIntModelWithTimestamps reference: https://gorm.io/docs/models.html#gorm-Model
func (*UUIDModelWithTimestamps) BeforeCreate ¶ added in v0.6.0
func (model *UUIDModelWithTimestamps) BeforeCreate(_ *gorm.DB) (err error)
func (UUIDModelWithTimestamps) IsLoaded ¶ added in v0.6.0
func (model UUIDModelWithTimestamps) IsLoaded() bool
func (UUIDModelWithTimestamps) SoftDeleteColumnName ¶ added in v0.6.0
func (model UUIDModelWithTimestamps) SoftDeleteColumnName() string
func (UUIDModelWithTimestamps) UpdatedAtColumnName ¶ added in v0.6.0
func (model UUIDModelWithTimestamps) UpdatedAtColumnName() string