Documentation ¶
Index ¶
- Constants
- Variables
- func Equal(v1, v2 interface{}) bool
- func EqualSet(obj1, obj2 interface{}) bool
- func Fprintln(writer io.Writer, values ...interface{})
- func Gopt_App_Main(app Apper)
- func PrettyPrintln(fprintln func(...interface{}) (int, error), values ...interface{})
- func Println(values ...interface{})
- type App
- type Apper
- type Context
- func (p *Context) Exec(executor Executor, code string) *Context
- func (p *Context) GetVar(key string) Var
- func (p *Context) Request(method, url string) *Request
- func (p *Context) Requestf(method, format string, v ...interface{}) *Request
- func (p *Context) Requestv(method, urlWithVar string) *Request
- func (p *Context) SetAuth(name string, auth TransportComposer)
- func (p *Context) SetHost(host string, portal string)
- func (p *Context) SetTransport(transport http.RoundTripper)
- type Executor
- type NilTestingT
- type Request
- func (p *Request) Ret(code int) (resp *Response)
- func (p *Request) WithAuth(v interface{}) *Request
- func (p *Request) WithBody(bodyType, body string) *Request
- func (p *Request) WithBodyf(bodyType, format string, v ...interface{}) *Request
- func (p *Request) WithBodyv(bodyType, bodyWithVar string) *Request
- func (p *Request) WithHeader(key string, values ...string) *Request
- func (p *Request) WithHeaderv(key string, valuesVar ...string) (resp *Request)
- type Response
- func (p *Response) GetBody(v interface{}) (resp *Response)
- func (p *Response) WithBody(bodyType, body string) (resp *Response)
- func (p *Response) WithBodyf(bodyType, format string, v ...interface{}) (resp *Response)
- func (p *Response) WithBodyv(bodyType, bodyVar string) (resp *Response)
- func (p *Response) WithHeader(k string, v ...string) (resp *Response)
- func (p *Response) WithHeaderv(key string, valuesVar ...string) (resp *Response)
- type TestingT
- type TransportComposer
- type Var
Constants ¶
View Source
const ( Fmttype_Json = vars.Fmttype_Json Fmttype_Form = vars.Fmttype_Form Fmttype_Text = vars.Fmttype_Text Fmttype_Jsonstr = vars.Fmttype_Jsonstr // 在json的字符串内 )
Variables ¶
View Source
var (
GoPackage = true
)
Functions ¶
func Gopt_App_Main ¶
func Gopt_App_Main(app Apper)
func PrettyPrintln ¶
Types ¶
type Context ¶
type Context struct { TestingT DefaultHeader http.Header MatchResponseError func(message string, req *Request, resp *Response) // contains filtered or unexported fields }
func (*Context) SetAuth ¶
func (p *Context) SetAuth(name string, auth TransportComposer)
func (*Context) SetTransport ¶
func (p *Context) SetTransport(transport http.RoundTripper)
type NilTestingT ¶
type NilTestingT struct{}
func (NilTestingT) Fatal ¶
func (p NilTestingT) Fatal(args ...interface{})
func (NilTestingT) Log ¶
func (p NilTestingT) Log(args ...interface{})
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func NewRequest ¶
type Response ¶
type Response struct { Header http.Header BodyType string RawBody []byte BodyObj interface{} Err error StatusCode int // contains filtered or unexported fields }
type TransportComposer ¶
type TransportComposer interface {
Compose(base http.RoundTripper) http.RoundTripper
}
Click to show internal directories.
Click to hide internal directories.