Documentation ¶
Index ¶
- Variables
- func BeforeOnce(beforeBlock func())
- func Delete(app *api.App, url, body string) (int, string)
- func Get(app *api.App, url string) (int, string)
- func GetBulkDonations(game *models.Game, clan string, ...) ([]*models.Player, []*models.DonationRequest, error)
- func GetConfPath() string
- func GetDefaultTestApp(logger zap.Logger) *api.App
- func GetFirstItem(g *models.Game) *models.Item
- func GetPerfMongoDB() (*mgo.Session, *mgo.Database)
- func GetRequest(app *api.App, ts *httptest.Server, method, url string, bodyBuff io.Reader) *http.Request
- func GetTestDonationRequest(game *models.Game, db *mgo.Database, logger zap.Logger) (*models.DonationRequest, error)
- func GetTestGame(db *mgo.Database, logger zap.Logger, withItems bool, ...) (*models.Game, error)
- func GetTestMongoDB() (*mgo.Session, *mgo.Database)
- func GetTestMutex(name string, rs *redsync.Redsync) *redsync.Mutex
- func GetTestPlayer(game *models.Game, db *mgo.Database, logger zap.Logger) (*models.Player, error)
- func GetTestRedis() redis.Conn
- func GetTestRedsync() *redsync.Redsync
- func InitializeTestServer(app *api.App) *httptest.Server
- func MockStdout()
- func PerformRequest(ts *httptest.Server, req *http.Request) *http.Response
- func Post(app *api.App, url, body string) (int, string)
- func Put(app *api.App, url, body string) (int, string)
- func ReadBody(res *http.Response) []byte
- func ToNullInt64(v int64) sql.NullInt64
- type MockClock
- type TestBuffer
Constants ¶
This section is empty.
Variables ¶
var ReadStdout func() string
ReadStdout value
var ResetStdout func()
ResetStdout back to os.Stdout
Functions ¶
func BeforeOnce ¶
func BeforeOnce(beforeBlock func())
BeforeOnce runs the before each block only once
func GetBulkDonations ¶
func GetBulkDonations(game *models.Game, clan string, donationRequestCount, donationsPerDonationRequest int, timestamp int64, db *mgo.Database, logger zap.Logger) ([]*models.Player, []*models.DonationRequest, error)
GetBulkDonations gets many donations and donation requests
func GetDefaultTestApp ¶
GetDefaultTestApp returns a new podium API Application bound to 0.0.0.0:8890 for test
func GetPerfMongoDB ¶
GetPerfMongoDB returns a test connection to PERF mongo db
func GetRequest ¶
func GetRequest(app *api.App, ts *httptest.Server, method, url string, bodyBuff io.Reader) *http.Request
GetRequest builds a new request for tests
func GetTestDonationRequest ¶
func GetTestDonationRequest(game *models.Game, db *mgo.Database, logger zap.Logger) (*models.DonationRequest, error)
GetTestDonationRequest to use in tests
func GetTestGame ¶
func GetTestGame(db *mgo.Database, logger zap.Logger, withItems bool, options ...map[string]interface{}) (*models.Game, error)
GetTestGame to use in tests
func GetTestMongoDB ¶
GetTestMongoDB returns a test connection to mongo db
func GetTestMutex ¶
GetTestMutex returns a mutex for the name specified
func GetTestPlayer ¶
GetTestPlayer to use in tests
func GetTestRedis ¶
GetTestRedis returns a configured redsync connection
func GetTestRedsync ¶
GetTestRedsync returns a configured redsync connection
func InitializeTestServer ¶
InitializeTestServer for tests
func PerformRequest ¶
PerformRequest against specified test server
Types ¶
type MockClock ¶
type MockClock struct {
Time int64
}
MockClock abstracts time
func (*MockClock) GetUTCTime ¶
GetUTCTime returns the mocked time
type TestBuffer ¶
TestBuffer is a mock buffer