Documentation ¶
Index ¶
- Constants
- func CloseMockTestT(ctx context.Context) context.Context
- func GetAppLog(ctx context.Context) log.Logger
- func GetUserClaim(ctx context.Context) *http.Claim
- func GetUserDB(ctx context.Context) *gorm.DB
- func GetUserLog(ctx context.Context, logName string) log.Logger
- func GetUserRedis(ctx context.Context) redis.RedisClient
- func IsMockTest(ctx context.Context) (*gomock.Controller, bool)
- func MockUniTestT(t *testing.T, testFunc func(context.Context, *gomock.Controller))
- func NewIntegrationTestContext() context.Context
- func NewUniTestContext() context.Context
- func RedisTablePrefix(ctx context.Context) string
- func Run(c *conf.AppConf, route http.RegisterRoute) error
- func SetAppState(ctx context.Context, state *StateFull) context.Context
- func ShardDB(userID string) (string, string, error)
- type StateFull
Constants ¶
View Source
const ( DefaultDB = "master" DefaultTablePrefix = "" )
View Source
const (
TestUserID = "testID"
)
Variables ¶
This section is empty.
Functions ¶
func CloseMockTestT ¶
CloseMockTestT 单元测试临时关闭mock
func GetUserRedis ¶
func GetUserRedis(ctx context.Context) redis.RedisClient
func IsMockTest ¶
func IsMockTest(ctx context.Context) (*gomock.Controller, bool)
func MockUniTestT ¶
MockUniTestT 单元测试 mock 数据
func NewIntegrationTestContext ¶
NewIntegrationTestContext 集成测试连接数据库
func NewUniTestContext ¶
func RedisTablePrefix ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.