Documentation ¶
Index ¶
- Variables
- func DiffModel(curr, prev interface{}) []string
- func RegisterConverter(entity ddd.IEntity, converter IConverter)
- func RegisterEntity2Model(entity ddd.IEntity, f1 Entity2Model, f2 Model2Entity)
- type Converter
- type Entity2Model
- type Executor
- func (e *Executor) Begin(ctx context.Context) (context.Context, error)
- func (e *Executor) Commit(ctx context.Context) error
- func (e *Executor) Diff(ctx context.Context, curr, prev ddd.IModel) ddd.IModel
- func (e *Executor) Entity2Model(entity, parent ddd.IEntity, op ddd.OpType) (ddd.IModel, error)
- func (e *Executor) Exec(ctx context.Context, action *ddd.Action) error
- func (e *Executor) Model2Entity(model ddd.IModel, entity ddd.IEntity) error
- func (e *Executor) RollBack(ctx context.Context) error
- type IConverter
- type IModel
- type Model2Entity
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidDB = fmt.Errorf("invalid db")
View Source
var ErrNoTransaction = fmt.Errorf("no transaction")
Functions ¶
func DiffModel ¶
func DiffModel(curr, prev interface{}) []string
DiffModel 模型差异对比,返回gorm命名规范的更新数据 支持以下类型比对:常规数据类型(bool, int, float, string, time.Time),嵌套可导出的非指针的 struct
func RegisterConverter ¶
func RegisterConverter(entity ddd.IEntity, converter IConverter)
RegisterConverter 使用时直接 mysql.RegisterConverter(&do{}, converter)
func RegisterEntity2Model ¶
func RegisterEntity2Model(entity ddd.IEntity, f1 Entity2Model, f2 Model2Entity)
Types ¶
type Entity2Model ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func NewExecutor ¶
func (*Executor) Entity2Model ¶
func (*Executor) Model2Entity ¶
type IConverter ¶
Click to show internal directories.
Click to hide internal directories.