Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TestErr = errors.New("error") TestErrStr = `{"error":"error"}` TestErrBadRequestStr = `{"error":"Bad Request"}` TestSuccessStr = `{}` )
View Source
var (
ErrTimeout = errors.New("waitgroup timeout")
)
Functions ¶
func CreateTestRequest ¶
func CreateTestRequest(t *testing.T, msg gin.H, b binding.Binding) (*httptest.ResponseRecorder, *gin.Context)
CreateTestRequest creates gin TestContext and inject request data in context and return.
func ReservePort ¶
func ReservePort() int
ReservePort automatically reserves available port in system.
Types ¶
type TimeoutWaitGroup ¶
TimeoutWaitGroup is a WaitGroup with timeout support.
func NewTimeoutWaitGroup ¶
func NewTimeoutWaitGroup(timeout time.Duration) *TimeoutWaitGroup
NewTimeoutWaitGroup creates new WaitGroup with timeout.
func (*TimeoutWaitGroup) Wait ¶
func (twg *TimeoutWaitGroup) Wait() error
Wait blocks until the WaitGroup counter is zero. An ErrTimeout is returned if it exceeds timeout.
Click to show internal directories.
Click to hide internal directories.