Documentation
¶
Overview ¶
Package gotest is a library that simulates the testing of cache, dao and handler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
Ctx context.Context
TestDataSlice []any
TestDataMap map[string]any
RedisClient *redis.Client
ICache any
// contains filtered or unexported fields
}
Cache redis cache
type Dao ¶
type Dao struct {
Ctx context.Context
TestData any
SQLMock sqlmock.Sqlmock
Cache *Cache
DB *gorm.DB
IDao any
AnyTime *anyTime
// contains filtered or unexported fields
}
Dao dao info
type Handler ¶
type Handler struct {
TestData any
MockDao *Dao
IHandler any
Engine *gin.Engine
HTTPServer *http.Server
// contains filtered or unexported fields
}
Handler info
func (*Handler) GetRequestURL ¶
GetRequestURL get request url from name
func (*Handler) GoRunHTTPServer ¶
func (h *Handler) GoRunHTTPServer(fns []RouterInfo)
GoRunHTTPServer run http server
type RCCache ¶
type RCCache struct {
Ctx context.Context
TestDataSlice []any
TestDataMap map[string]any
RedisClient *redis.ClusterClient
ICache any
// contains filtered or unexported fields
}
RCCache redis cluster cache
func NewRCCache ¶
NewRCCache instantiated redis cluster cache
func (*RCCache) GetTestData ¶
GetTestData get test data
type RouterInfo ¶
type RouterInfo struct {
FuncName string
Method string
Path string
HandlerFunc gin.HandlerFunc
}
RouterInfo router info
Click to show internal directories.
Click to hide internal directories.