Documentation ¶
Index ¶
- func AppTransaction(ctx context.Context, fn func(context.Context) error) error
- func AppendLogsFields(ctx context.Context, fields ...zap.Field)
- func CreateJwtClaimsToken(claims defs.JwtClaims) (string, error)
- func Error(ctx context.Context, msg string, fields ...zap.Field)
- func GetAppDB(ctx context.Context) *gorm.DB
- func GetAppDBWithCtx(ctx context.Context) *gorm.DB
- func GetJwtClaims(ctx context.Context) (defs.JwtClaims, error)
- func GetJwtClaimsByBearerToken(c *gin.Context) (defs.JwtClaims, error)
- func GetJwtClaimsByGrpcCtx(ctx context.Context) (context.Context, defs.JwtClaims, error)
- func GetLogLayout(ctx context.Context) *defs.LogLayout
- func GetSpanContext(ctx context.Context) context.Context
- func GetTenantID(ctx context.Context) string
- func GetTenantIDByGrpcCtx(ctx context.Context) (context.Context, string)
- func GetTenantTableDBWithCtx(ctx context.Context, tablePrefile string) *gorm.DB
- func GetTraceID(ctx context.Context) string
- func GetTraceIDByGrpcCtx(ctx context.Context) (context.Context, string)
- func GetTraceSpanIDByGrpcCtx(ctx context.Context) string
- func NewJwtClaimsToken(tenantID string, userID uint64, username string, auths []string, ...) (string, error)
- func ParseYhUserTokenClaims(tokenString string) (*defs.JwtClaims, error)
- func SetLogLayout2GinCtx(ctx *gin.Context, layout *defs.LogLayout)
- func SetSpanContext(ctx *gin.Context, spanCtx context.Context)
- func SetTraceID(ctx *gin.Context, traceID string)
- func ShouldBindJSON[T any](c *gin.Context, obj T, check func(arg T) bool, rs ...any) (ctx context.Context, err error)
- func ShouldBindQuery[T any](c *gin.Context, obj T, check func(arg T) bool, rs ...any) (ctx context.Context, err error)
- func Warn(ctx context.Context, msg string, fields ...zap.Field)
- func WithValueAppDB(ctx context.Context, db *gorm.DB) context.Context
- func WithValueLogLayout(ctx context.Context, layout *defs.LogLayout) context.Context
- func WithValueTenant(ctx context.Context, tenantID string) context.Context
- func WithValueTenantID(ctx context.Context, tenantID string) context.Context
- func WithValueTraceID(ctx context.Context, traceID string) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppTransaction ¶
func GetJwtClaimsByGrpcCtx ¶
func GetTenantID ¶
func GetTenantIDByGrpcCtx ¶
func GetTenantTableDBWithCtx ¶
func GetTraceID ¶
func GetTraceSpanIDByGrpcCtx ¶
func NewJwtClaimsToken ¶
func ParseYhUserTokenClaims ¶
func SetTraceID ¶
func ShouldBindJSON ¶
func ShouldBindJSON[T any](c *gin.Context, obj T, check func(arg T) bool, rs ...any) (ctx context.Context, err error)
ShouldBindJSON 解析并验证请求body参数,返回链路span上下文 check:额外自定义的VO校验方法
func ShouldBindQuery ¶
func ShouldBindQuery[T any](c *gin.Context, obj T, check func(arg T) bool, rs ...any) (ctx context.Context, err error)
ShouldBindQuery 解析并验证请求query参数,返回链路span上下文 check:额外自定义的VO校验方法
func WithValueLogLayout ¶
func WithValueTenantID ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.