unified

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAccessDenied

func IsAccessDenied(err error) bool

IsAccessDenied - 检查是否是访问拒绝错误

func IsAlreadyExists

func IsAlreadyExists(err error) bool

IsAlreadyExists - 检查是否是已存在错误

func IsConflict

func IsConflict(err error) bool

IsConflict - 检查是否是冲突错误

func IsNotFound

func IsNotFound(err error) bool

IsNotFound - 检查是否是 NotFound 错误

func NewQuery

func NewQuery() *repository.Query

NewQuery - 创建新的查询条件

Types

type BaseRepository

type BaseRepository[T any] = repository.BaseRepository[T]

BaseRepository - 基础仓储实现

type BusinessError

type BusinessError = errors.AppError

BusinessError - 业务错误

func NewAccessDenied

func NewAccessDenied(reason string) *BusinessError

NewAccessDenied - 创建访问拒绝错误

func NewConflict

func NewConflict(resource string) *BusinessError

NewConflict - 创建冲突错误

func NewDatabaseError

func NewDatabaseError(operation string, err error) *BusinessError

NewDatabaseError - 创建数据库错误

func NewInternal

func NewInternal(message string) *BusinessError

NewInternal - 创建内部错误

func NewInvalidInput

func NewInvalidInput(field string, reason string) *BusinessError

NewInvalidInput - 创建无效输入错误

func NewNotFound

func NewNotFound(resource string) *BusinessError

NewNotFound - 创建 NotFound 错误

type ErrorCode

type ErrorCode = errors.ErrorCode

ErrorCode - 错误码

type Filter

type Filter = repository.Filter

Filter - 查询过滤条件

func Between

func Between(field string, min, max interface{}) *Filter

Between - BETWEEN 过滤

func Eq

func Eq(field string, value interface{}) *Filter

Eq - 等于过滤

func Gt

func Gt(field string, value interface{}) *Filter

Gt - 大于过滤

func Gte

func Gte(field string, value interface{}) *Filter

Gte - 大于等于过滤

func In

func In(field string, values ...interface{}) *Filter

In - IN 过滤

func Like

func Like(field string, value string) *Filter

Like - LIKE 过滤

func Lt

func Lt(field string, value interface{}) *Filter

Lt - 小于过滤

func Lte

func Lte(field string, value interface{}) *Filter

Lte - 小于等于过滤

func Neq

func Neq(field string, value interface{}) *Filter

Neq - 不等于过滤

type Handler

type Handler = db.Handler

Handler - 数据库处理器接口

func NewGormHandler

func NewGormHandler(gormDB interface{}) Handler

NewGormHandler - 创建 GORM 处理器 需要导入 gorm,从 gorm.DB 创建处理器

type Logger

type Logger = logger.Logger

Logger - 日志接口

type Order

type Order = repository.Order

Order - 排序条件

type Paging

type Paging = meta.Paging

Paging - 分页信息

func NewPaging

func NewPaging(page, pageSize int) *Paging

NewPaging - 创建分页信息

type Query

type Query = repository.Query

Query - 查询构建器

type Repository

type Repository[T any] = repository.Repository[T]

Repository - 通用仓储接口

func NewBaseRepository

func NewBaseRepository[T any](handler Handler, tableName string) Repository[T]

NewBaseRepository - 创建基础仓储

type Transaction

type Transaction = repository.Transaction

Transaction - 事务接口

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL