Documentation
¶
Index ¶
- type DeletedAt
- func (DeletedAt) DeleteClauses(field *schema.Field) []clause.Interface
- func (DeletedAt) GormDBDataType(db *gorm.DB, _ *schema.Field) string
- func (DeletedAt) GormDataType() string
- func (x DeletedAt) MarshalJSON() ([]byte, error)
- func (DeletedAt) QueryClauses(field *schema.Field) []clause.Interface
- func (x *DeletedAt) Scan(value any) error
- func (x *DeletedAt) UnmarshalJSON(bytes []byte) error
- func (DeletedAt) UpdateClauses(field *schema.Field) []clause.Interface
- func (x DeletedAt) Value() (driver.Value, error)
- type Field
- type JSON
- func (x JSON) Get(path string) gjson.Result
- func (JSON) GormDBDataType(db *gorm.DB, _ *schema.Field) string
- func (JSON) GormDataType() string
- func (x JSON) GormValue(_ context.Context, db *gorm.DB) clause.Expr
- func (x JSON) MarshalJSON() ([]byte, error)
- func (x JSON) MustUnmarshal[T any]() T
- func (x JSON) Parse() gjson.Result
- func (x *JSON) Scan(value any) error
- func (x JSON) String() string
- func (x JSON) Unmarshal[T any]() (t T, err error)
- func (x *JSON) UnmarshalJSON(bytes []byte) error
- func (x JSON) Valid() bool
- func (x JSON) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeletedAt ¶
type DeletedAt int64
DeletedAt 使用 0 表示有效记录,使用 Unix 毫秒时间戳表示已删除记录。
func (DeletedAt) DeleteClauses ¶
func (DeletedAt) GormDBDataType ¶
func (DeletedAt) GormDataType ¶
func (DeletedAt) MarshalJSON ¶
func (DeletedAt) QueryClauses ¶
func (*DeletedAt) UnmarshalJSON ¶
func (DeletedAt) UpdateClauses ¶
type JSON ¶
type JSON json.RawMessage
JSON 是可直接持久化并通过 gjson 路径读取的原始 JSON 文档。
func (JSON) GormDataType ¶
func (JSON) MarshalJSON ¶
func (JSON) MustUnmarshal ¶ added in v1.0.5
MustUnmarshal 行为与 Unmarshal 一致,但失败时 panic 并由 core/codec/json 统一打印调用堆栈, 仅适用于文档格式已在初始化阶段保证正确的场景。
func (JSON) Unmarshal ¶ added in v1.0.5
Unmarshal 使用 core/codec/json 将文档反序列化为类型 T,文档不完整或与 T 结构不匹配时返回错误, 失败时保持 T 的零值。
func (*JSON) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.