Documentation ¶
Index ¶
- func GetGinConfig(c *check.C) *ogin.GinConfig
- func GetWebHost() string
- func GetWebPort() uint16
- func GetWebUrl() string
- func HasWebConfigOrSkip(c *check.C) bool
- func StartGinWebServer(c *check.C, engineFunc GinEngineConfigFunc)
- type CheckSlint
- type GinEngineConfigFunc
- type HttpClientConfig
- type ResponseResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetWebHost ¶
func GetWebHost() string
func GetWebPort ¶
func GetWebPort() uint16
func HasWebConfigOrSkip ¶
func StartGinWebServer ¶
func StartGinWebServer(c *check.C, engineFunc GinEngineConfigFunc)
Types ¶
type CheckSlint ¶
type CheckSlint struct { Slint *sling.Sling LastResponse *http.Response // contains filtered or unexported fields }
Slint with checker
func NewCheckSlint ¶
func NewCheckSlint(checker *checker.C, sling *sling.Sling) *CheckSlint
Initialize a checker with slint support
func (*CheckSlint) AssertHasPaging ¶
func (self *CheckSlint) AssertHasPaging()
Asserts the existing of paging header
func (*CheckSlint) GetJsonBody ¶
func (self *CheckSlint) GetJsonBody(expectedStatus int) *json.Json
Gets body as JSON
The exepcted status is used to get expected status
func (*CheckSlint) GetResponse ¶
func (self *CheckSlint) GetResponse() *http.Response
Gets the response for current request
func (*CheckSlint) GetStringBody ¶
func (self *CheckSlint) GetStringBody(expectedStatus int) string
Gets body as string
The exepcted status is used to get expected status
type GinEngineConfigFunc ¶
type HttpClientConfig ¶
type HttpClientConfig struct { Ssl bool Host string Port uint16 Resource string // contains filtered or unexported fields }
The configuration of http client
func NewHttpClientConfigByFlag ¶
func NewHttpClientConfigByFlag() *HttpClientConfig
Initialize a client config by flag
http_host - host name of http service http_port - port of http service http_ssl - whether or not use SSL to test http service
func (*HttpClientConfig) NewSlingByBase ¶
func (self *HttpClientConfig) NewSlingByBase() *sling.Sling
func (*HttpClientConfig) String ¶
func (self *HttpClientConfig) String() string
Gets the full URL of tested service
type ResponseResult ¶
func NewResponseResultByRequest ¶
func NewResponseResultByRequest(req *http.Request) *ResponseResult
Performs request and reads the body into []byte
func NewResponseResultByResponse ¶
func NewResponseResultByResponse(resp *http.Response) *ResponseResult
func NewResponseResultBySling ¶
func NewResponseResultBySling(slingObj *sling.Sling) *ResponseResult
Performs request and reads the body into []byte
func (*ResponseResult) GetBodyAsJson ¶
func (r *ResponseResult) GetBodyAsJson() *json.Json
func (*ResponseResult) GetBodyAsString ¶
func (r *ResponseResult) GetBodyAsString() string
Click to show internal directories.
Click to hide internal directories.