Documentation
¶
Index ¶
- func Get(r http.Handler, path string) *httptest.ResponseRecorder
- func GetWithHeaders(r http.Handler, path string, headers map[string]string) *httptest.ResponseRecorder
- func Post(r http.Handler, path, body string) *httptest.ResponseRecorder
- func SetGinContext(r *gin.Engine, ctxs map[string]interface{})
- type MockedCache
- func (m *MockedCache) HGet(key, field string) (string, error)
- func (m *MockedCache) HGetAll(key string) (map[string]string, error)
- func (m *MockedCache) HSet(key, field string, value interface{}) (bool, error)
- func (m *MockedCache) SCard(key string) (int64, error)
- func (m *MockedCache) SIsMember(key string, member interface{}) (bool, error)
- func (m *MockedCache) SMembers(key string) ([]string, error)
- func (m *MockedCache) TxPipeline() redis.Pipeliner
- func (m *MockedCache) Z(score float64, member interface{}) redis.Z
- func (m *MockedCache) ZRangeByScore(key string, opt redis.ZRangeBy) ([]string, error)
- type MockedDatabase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get(r http.Handler, path string) *httptest.ResponseRecorder
Get does an HTTP GET request against an HTTP handler
func GetWithHeaders ¶
func GetWithHeaders(r http.Handler, path string, headers map[string]string) *httptest.ResponseRecorder
GetWithHeaders does an HTTP GET request with custom headers against an HTTP handler
func Post ¶
func Post(r http.Handler, path, body string) *httptest.ResponseRecorder
Post does an HTTP POST request against an HTTP handler
func SetGinContext ¶
SetGinContext sets custom Gin contexts
Types ¶
type MockedCache ¶
MockedCache is a dummy cache handler
func (*MockedCache) HGet ¶
func (m *MockedCache) HGet(key, field string) (string, error)
HGet mocks the same redis.Client method
func (*MockedCache) HGetAll ¶
func (m *MockedCache) HGetAll(key string) (map[string]string, error)
HGetAll mocks the same redis.Client method
func (*MockedCache) HSet ¶
func (m *MockedCache) HSet(key, field string, value interface{}) (bool, error)
HSet mocks the same redis.Client method
func (*MockedCache) SCard ¶
func (m *MockedCache) SCard(key string) (int64, error)
SCard mocks the same redis.Client method
func (*MockedCache) SIsMember ¶
func (m *MockedCache) SIsMember(key string, member interface{}) (bool, error)
SIsMember mocks the same redis.Client method
func (*MockedCache) SMembers ¶
func (m *MockedCache) SMembers(key string) ([]string, error)
SMembers mocks the same redis.Client method
func (*MockedCache) TxPipeline ¶
func (m *MockedCache) TxPipeline() redis.Pipeliner
TxPipeline mocks the same redis.Client method
func (*MockedCache) Z ¶
func (m *MockedCache) Z(score float64, member interface{}) redis.Z
Z mocks the redis.Z struct
func (*MockedCache) ZRangeByScore ¶
ZRangeByScore mocks the same redis.Client method
type MockedDatabase ¶
MockedDatabase is a dummy database handler
func (*MockedDatabase) Exec ¶
func (m *MockedDatabase) Exec(q string, a ...interface{}) (sql.Result, error)
Exec mocks the same sql.DB method
func (*MockedDatabase) Get ¶
func (m *MockedDatabase) Get(d interface{}, q string, a ...interface{}) error
Get mocks the same sqlx.DB method
func (*MockedDatabase) Select ¶
func (m *MockedDatabase) Select(d interface{}, q string, a ...interface{}) error
Select mocks the same sqlx.DB method