testutils

package
v0.0.0-...-8ffee41 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

一些用于测试的工具函数

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cache

func Cache()

Cache 注册缓存组件

func Database

func Database(t *testing.T) (context.Context, *gorm.DB, sqlmock.Sqlmock)

Database 创建基于 sqlmock 的数据库测试环境 返回带有 mock 数据库的 context,业务代码通过 db.Ctx(ctx) 自动使用 mock 实例

func IAM

func IAM(t *testing.T, database authn.Database, opts ...iam.Option)

IAM 注册IAM组件

func Redis

func Redis()

Redis 注册Redis组件

func RunTestEnv

func RunTestEnv()

Types

This section is empty.

Jump to

Keyboard shortcuts

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