Documentation ¶
Index ¶
- Constants
- type Data
- type Set
- func (slf *Set[PrimaryKey, Body]) Get(index PrimaryKey) (*Data[Body], error)
- func (slf *Set[PrimaryKey, Body]) New() *Data[Body]
- func (slf *Set[PrimaryKey, Body]) Save(data *Data[Body]) error
- func (slf *Set[PrimaryKey, Body]) Set(data *Data[Body])
- func (slf *Set[PrimaryKey, Body]) Struct(data *Data[Body]) (any, error)
- type SetOption
- func WithBodyName[PrimaryKey generic.Ordered, Body any](name string) SetOption[PrimaryKey, Body]
- func WithBodyTag[PrimaryKey generic.Ordered, Body any](tags ...string) SetOption[PrimaryKey, Body]
- func WithIndex[PrimaryKey generic.Ordered, Index generic.Ordered, Body any](name string, getValue func(data Body) Index) SetOption[PrimaryKey, Body]
- func WithTagIndex[PrimaryKey generic.Ordered, Index generic.Ordered, Body any](name string, tags []string, getValue func(data Body) Index) SetOption[PrimaryKey, Body]
- type Storage
Constants ¶
View Source
const (
DefaultBodyFieldName = "Data"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶ added in v0.0.20
type Data[Body any] struct { // contains filtered or unexported fields }
Data 数据存储
- 数据存储默认拥有一个 Body 字段
type Set ¶ added in v0.0.20
Set 数据集合
type SetOption ¶ added in v0.0.20
func WithBodyTag ¶ added in v0.0.20
WithBodyTag 设置 Body 字段标签
- 如果有多个标签,将会以空格分隔,例如:`json:"data" yaml:"data"`
Click to show internal directories.
Click to hide internal directories.