Documentation
¶
Index ¶
- type AppServer
- type BulkOperateObjectRequest
- type CreateObjectResponse
- type CreateRefObjectRequest
- type DbBulkRetrieve
- type DbCreate
- type DbDelete
- type DbEdit
- type DbOperation
- type DbRetrieve
- type DbUpdate
- type DeleteRefObjectRequest
- type EditRefObjectRequest
- type GetRefObjectRequest
- type HookFunction
- type ObjectKeyType
- type OperateObjectRequest
- type QueryObjectRequest
- type QueryObjectResponse
- type QueryRefObjectRequest
- type QueryRefObjectResponse
- type RefDbBulkRetrieve
- type RefDbCreate
- type RefDbDelete
- type RefDbEdit
- type RefDbOperation
- type RefDbRetrieve
- type RefDbUpdate
- type ServiceCreate
- type ServiceDelete
- type ServiceGet
- type ServiceOperation
- type ServiceQuery
- type ServiceRetrieve
- type ServiceUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppServer ¶
type AppServer interface {
Start() error // 开始
Stop(forced ...bool) error // 默认为优雅关闭, 如果forced为true, 则强制关闭
HookPreStart(fns ...HookFunction) AppServer // 添加启动前的钩子函数
HookPreStop(fns ...HookFunction) AppServer // 添加停止前的钩子函数
}
type BulkOperateObjectRequest ¶
type BulkOperateObjectRequest[TObjectKey ObjectKeyType] struct { Keys []TObjectKey `json:"keys"` }
type CreateObjectResponse ¶
type CreateObjectResponse[TObjectId ObjectKeyType] struct { Id TObjectId `json:"id"` }
type CreateRefObjectRequest ¶
type CreateRefObjectRequest[TObjectKey ObjectKeyType, TBizObject any] struct { Key TObjectKey `json:"key"` Item TBizObject `json:"item"` }
type DbBulkRetrieve ¶
type DbBulkRetrieve[TObjectKey ObjectKeyType, ModelObject any] interface { BulkGet(ids []TObjectKey) (map[TObjectKey]ModelObject, error) // 批量获取对象 }
DbBulkRetrieve 批量读取
type DbCreate ¶
type DbCreate[BizObject any, ModelObject any] interface { Create(bizObj BizObject) (ModelObject, error) // 创建对象 }
DbCreate 创建操作:C
type DbDelete ¶
type DbDelete[TObjectKey ObjectKeyType] interface { Delete(key TObjectKey) error // 删除对象 }
DbDelete 删除
type DbOperation ¶
type DbOperation[TObjectKey ObjectKeyType, TBizObject any, TModelObject any, TCondition any] interface { DbCreate[TBizObject, TModelObject] DbRetrieve[TObjectKey, TModelObject, TCondition] DbUpdate[TModelObject] DbDelete[TObjectKey] }
type DbRetrieve ¶
type DbRetrieve[TObjectKey ObjectKeyType, TModelObject any, TCondition any] interface { Get(key TObjectKey) (TModelObject, error) // 获取对象 Count(filters map[string]string) (int64, error) // 统计对象 List(filters map[string]string, list ...*protobuf.ListParam) ([]TModelObject, error) // 列出对象, list不传的时候获取所有对象 GetQueryConditions(filters map[string]string) []TCondition // 获取查询条件 }
DbRetrieve 读操作
type DeleteRefObjectRequest ¶
type DeleteRefObjectRequest[TObjectKey ObjectKeyType] struct { Key TObjectKey `json:"key"` ItemKey TObjectKey `json:"itemKey"` }
type EditRefObjectRequest ¶
type EditRefObjectRequest[TObjectKey ObjectKeyType, TBizObject any] struct { Key TObjectKey `json:"key"` Item TBizObject `json:"item"` }
type GetRefObjectRequest ¶
type GetRefObjectRequest[TObjectKey ObjectKeyType] struct { Key TObjectKey `json:"key"` ItemKey TObjectKey `json:"itemKey"` }
type HookFunction ¶
type HookFunction func() error
type OperateObjectRequest ¶
type OperateObjectRequest[TObjectKey ObjectKeyType] struct { Key TObjectKey `json:"key"` }
type QueryObjectRequest ¶
type QueryObjectResponse ¶
type QueryRefObjectRequest ¶
type QueryRefObjectRequest[TObjectKey ObjectKeyType] struct { Key TObjectKey `json:"key"` Filters map[string]string `json:"filters,omitempty"` List *protobuf.ListParam `json:"list,omitempty"` }
type QueryRefObjectResponse ¶
type RefDbBulkRetrieve ¶
type RefDbBulkRetrieve[TObjectKey ObjectKeyType, TRefModelObject any] interface { BulkGet(key TObjectKey, refKeys []TObjectKey) (map[TObjectKey]TRefModelObject, error) // 批量获取对象 }
RefDbBulkRetrieve 批量读取关联对象
type RefDbCreate ¶
type RefDbCreate[TObjectKey ObjectKeyType, TRefBizObject any, TRefModelObject any] interface { Create(key TObjectKey, refBizObj TRefBizObject) (TRefModelObject, error) // 创建关联对象DAO }
RefDbCreate 创建关联对象操作:C
type RefDbDelete ¶
type RefDbDelete[TObjectKey ObjectKeyType] interface { Delete(key, refKey TObjectKey) error // 删除关联对象DAO }
RefDbDelete 删除关联对象
type RefDbEdit ¶
type RefDbEdit[TObjectKey ObjectKeyType, TRefBizObject any] interface { Edit(key TObjectKey, refBizObj TRefBizObject) error // 编辑数据库关联对象DAO }
type RefDbOperation ¶
type RefDbOperation[TObjectKey ObjectKeyType, TRefBizObject any, TRefModelObject any, TCondition any] interface { RefDbCreate[TObjectKey, TRefBizObject, TRefModelObject] RefDbRetrieve[TObjectKey, TRefModelObject, TCondition] RefDbUpdate[TRefModelObject] RefDbDelete[TObjectKey] }
type RefDbRetrieve ¶
type RefDbRetrieve[TObjectKey ObjectKeyType, TRefModelObject any, Condition any] interface { Get(key, refKey TObjectKey) (TRefModelObject, error) // 获取关联对象DAO Count(key TObjectKey, refObjFilters map[string]string) (int64, error) // 统计关联对象DAO List(key TObjectKey, refObjFilters map[string]string, list ...*protobuf.ListParam) ([]TRefModelObject, error) // 列出关联对象DAO GetQueryConditions(key TObjectKey, refObjFilters map[string]string) []Condition // 获取关联对象DAO }
RefDbRetrieve 读取关联对象操作:R
type RefDbUpdate ¶
type RefDbUpdate[TRefObjectModel any] interface { Update(refObjModel TRefObjectModel) error // 更新数据库关联对象 }
RefDbUpdate 更新关联对象:U
type ServiceCreate ¶
type ServiceDelete ¶
type ServiceDelete[TObjectKey ObjectKeyType] interface { Delete(ctx context.Context, key TObjectKey) error // 删除业务对象 }
type ServiceGet ¶ added in v0.0.11
type ServiceGet[TObjectKey ObjectKeyType, TBizObject any] interface { Get(ctx context.Context, key TObjectKey) (TBizObject, error) // 获取业务对象 }
type ServiceOperation ¶
type ServiceOperation[TObjectKey ObjectKeyType, TBizObject any] interface { ServiceCreate[TBizObject] ServiceRetrieve[TObjectKey, TBizObject] ServiceUpdate[TBizObject] ServiceDelete[TObjectKey] }
type ServiceQuery ¶ added in v0.0.11
type ServiceRetrieve ¶
type ServiceRetrieve[TObjectKey ObjectKeyType, TBizObject any] interface { ServiceGet[TObjectKey, TBizObject] ServiceQuery[TBizObject] }
Click to show internal directories.
Click to hide internal directories.