Documentation ¶
Index ¶
- func BindSimple[I any](binder *binding.Binder, simple *Simple[I], opts ...Option[I])
- func Create(tableName string, callbacks *Callbacks[any]) binding.ServiceFunc[any]
- func CreateTx(tableName string, callbacks *Callbacks[any]) binding.ServiceFunc[any]
- func Delete(tableName string, callbacks *Callbacks[any]) binding.ServiceFunc[any]
- func DeleteTx(tableName string, callbacks *Callbacks[any]) binding.ServiceFunc[any]
- func Query[O any](tableName string, callbacks *Callbacks[response.InfosData[O]], ...) binding.ServiceFunc[response.InfosData[O]]
- type Callbacks
- type ConditionFieldCallback
- type Option
- func WithCreateCallbacks[I any](callbacks *Callbacks[any]) Option[I]
- func WithCreateMiddlewares[I any](middlewares []api.Handler) Option[I]
- func WithCreateTx[I any]() Option[I]
- func WithDeleteCallbacks[I any](callbacks *Callbacks[any]) Option[I]
- func WithDeleteMiddlewares[I any](middlewares []api.Handler) Option[I]
- func WithDeleteTx[I any]() Option[I]
- func WithDisableCreate[I any]() Option[I]
- func WithDisableDelete[I any]() Option[I]
- func WithDisableQuery[I any]() Option[I]
- func WithQueryCallbacks[I any](callbacks *Callbacks[response.InfosData[I]]) Option[I]
- func WithQueryConditionFieldCallback[I any](callback ConditionFieldCallback) Option[I]
- func WithQueryMiddlewares[I any](middlewares []api.Handler) Option[I]
- type Options
- type Simple
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindSimple ¶
Types ¶
type Callbacks ¶
type Callbacks[O any] struct { BeforeDBOperate func(valueObject value_object.ValueObject, i *infrastructure.Infrastructure, dbExecutor database.Executor) error AfterDBOperate func(valueObject value_object.ValueObject, i *infrastructure.Infrastructure, dbExecutor database.Executor) error OnSuccessReturn func(valueObject value_object.ValueObject, i *infrastructure.Infrastructure, output O) (O, error) OnErrorReturn func(valueObject value_object.ValueObject, err error, i *infrastructure.Infrastructure, defaultErrOutput O) (O, error) }
type ConditionFieldCallback ¶
type Option ¶
func WithCreateTx ¶
func WithDeleteTx ¶
func WithDisableCreate ¶
func WithDisableDelete ¶
func WithDisableQuery ¶
func WithQueryCallbacks ¶
func WithQueryConditionFieldCallback ¶
func WithQueryConditionFieldCallback[I any](callback ConditionFieldCallback) Option[I]
type Simple ¶
type Simple[I any] struct { // 使用的领域实体,注意是ValueObject类型 ValueObject value_object.ValueObject // 数据库schema Schema string // 创建使用的请求参数 CreateJsonBody request.Params // 删除使用的请求参数 DeleteJsonBody request.Params // 查询使用的请求参数,注意是Query类型 QueryQueryParams request.QueryRequestParams // contains filtered or unexported fields }
Simple 值对象CRD的Bind参数 I 为查询相关接口返回的Info类型
Click to show internal directories.
Click to hide internal directories.