Documentation
¶
Index ¶
- func Do(ctx context.Context, doc interface{}, opType operator.OpType, ...) error
- type CustomFields
- func (c CustomFields) CustomCreateBy(ctx context.Context, doc interface{})
- func (c CustomFields) CustomCreateTime(ctx context.Context, doc interface{})
- func (c CustomFields) CustomId(ctx context.Context, doc interface{})
- func (c CustomFields) CustomUpdateBy(ctx context.Context, doc interface{})
- func (c CustomFields) CustomUpdateTime(ctx context.Context, doc interface{})
- func (c *CustomFields) SetCreateAt(fieldName string) CustomFieldsBuilder
- func (c *CustomFields) SetCreateBy(fieldName string, key string) CustomFieldsBuilder
- func (c *CustomFields) SetId(fieldName string) CustomFieldsBuilder
- func (c *CustomFields) SetUpdateAt(fieldName string) CustomFieldsBuilder
- func (c *CustomFields) SetUpdateBy(fieldName string, key string) CustomFieldsBuilder
- type CustomFieldsBuilder
- type CustomFieldsHook
- type DefaultField
- type DefaultFieldHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CustomFields ¶
type CustomFields struct {
// contains filtered or unexported fields
}
CustomFields defines struct of supported custom fields
func (CustomFields) CustomCreateBy ¶ added in v1.2.6
func (c CustomFields) CustomCreateBy(ctx context.Context, doc interface{})
CustomCreateBy changes the custom create by
func (CustomFields) CustomCreateTime ¶
func (c CustomFields) CustomCreateTime(ctx context.Context, doc interface{})
CustomCreateTime changes the custom create time
func (CustomFields) CustomId ¶
func (c CustomFields) CustomId(ctx context.Context, doc interface{})
CustomUpdateTime changes the custom update time
func (CustomFields) CustomUpdateBy ¶ added in v1.2.6
func (c CustomFields) CustomUpdateBy(ctx context.Context, doc interface{})
CustomUpdateBy changes the custom update by
func (CustomFields) CustomUpdateTime ¶
func (c CustomFields) CustomUpdateTime(ctx context.Context, doc interface{})
CustomUpdateTime changes the custom update time
func (*CustomFields) SetCreateAt ¶
func (c *CustomFields) SetCreateAt(fieldName string) CustomFieldsBuilder
SetCreateAt set the custom CreateAt field
func (*CustomFields) SetCreateBy ¶ added in v1.2.6
func (c *CustomFields) SetCreateBy(fieldName string, key string) CustomFieldsBuilder
SetCreateBy set the custom CreateAt field
func (*CustomFields) SetId ¶
func (c *CustomFields) SetId(fieldName string) CustomFieldsBuilder
SetId set the custom Id field
func (*CustomFields) SetUpdateAt ¶
func (c *CustomFields) SetUpdateAt(fieldName string) CustomFieldsBuilder
SetUpdateAt set the custom UpdateAt field
func (*CustomFields) SetUpdateBy ¶ added in v1.2.6
func (c *CustomFields) SetUpdateBy(fieldName string, key string) CustomFieldsBuilder
SetUpdateBy set the custom UpdateAt field
type CustomFieldsBuilder ¶
type CustomFieldsBuilder interface { SetUpdateAt(fieldName string) CustomFieldsBuilder SetUpdateBy(fieldName string, key string) CustomFieldsBuilder SetCreateAt(fieldName string) CustomFieldsBuilder SetCreateBy(fieldName string, key string) CustomFieldsBuilder SetId(fieldName string) CustomFieldsBuilder }
CustomFieldsBuilder defines the interface which user use to set custom fields
func NewCustom ¶
func NewCustom() CustomFieldsBuilder
NewCustom creates new Builder which is used to set the custom fields
type CustomFieldsHook ¶
type CustomFieldsHook interface {
CustomFields() CustomFieldsBuilder
}
CustomFieldsHook defines the interface, CustomFields return custom field user want to change
type DefaultField ¶
type DefaultField struct { Id primitive.ObjectID `bson:"_id"` CreateAt time.Time `bson:"createAt"` CreateBy string `bson:"createBy"` UpdateAt time.Time `bson:"updateAt"` UpdateBy string `bson:"updateBy"` }
DefaultField defines the default fields to handle when operation happens import the DefaultField in document struct to make it working
func (*DefaultField) DefaultCreateAt ¶
func (df *DefaultField) DefaultCreateAt()
DefaultCreateAt changes the default createAt field
func (*DefaultField) DefaultCreateBy ¶ added in v1.2.6
func (df *DefaultField) DefaultCreateBy()
DefaultCreateBy changes the default createBy field
func (*DefaultField) DefaultId ¶
func (df *DefaultField) DefaultId()
DefaultId changes the default _id field
func (*DefaultField) DefaultUpdateAt ¶
func (df *DefaultField) DefaultUpdateAt()
DefaultUpdateAt changes the default updateAt field
func (*DefaultField) DefaultUpdateBy ¶ added in v1.2.6
func (df *DefaultField) DefaultUpdateBy()
DefaultUpdateBy changes the default updateBy field
type DefaultFieldHook ¶
type DefaultFieldHook interface { DefaultUpdateAt() DefaultCreateAt() DefaultId() }
DefaultFieldHook defines the interface to change default fields by hook