Documentation ¶
Index ¶
- func StartHttpGetAsync()
- func StartHttpPostAsync()
- type AsyncHttpServer
- type HttpAsyncHandler
- type HttpForm
- func (h *HttpForm) GetArray(key string) JsonArray
- func (h *HttpForm) GetBool(key string) bool
- func (h *HttpForm) GetError() error
- func (h *HttpForm) GetInt(key string) int
- func (h *HttpForm) GetInt64(key string) int64
- func (h *HttpForm) GetMap(key string) JsonMap
- func (h *HttpForm) GetString(key string) string
- func (h *HttpForm) GetUint(key string) uint
- func (h *HttpForm) GetUint64(key string) uint64
- func (h *HttpForm) HeaderValue(key string) string
- type HttpFormAsync
- type HttpRequest
- func (r *HttpRequest) Request(router string, params interface{}) ([]byte, error)
- func (c *HttpRequest) RequestGet(router string, header map[string]string) (*http.Response, error)
- func (r *HttpRequest) RequestJsonArray(router string, params interface{}) (JsonArray, error)
- func (r *HttpRequest) RequestJsonMap(router string, params interface{}) (JsonMap, error)
- func (r *HttpRequest) RequestPost(router string, data []byte, header map[string]string) ([]byte, error)
- type HttpRequestAsync
- func (r *HttpRequestAsync) HandleHttpResponse()
- func (r *HttpRequestAsync) Release()
- func (r *HttpRequestAsync) Request(router string, params interface{}, respHandler RespHandler, ...)
- func (r *HttpRequestAsync) RequestGet(router string, header map[string]string, respHandler RespHandler, ...)
- func (r *HttpRequestAsync) RequestJsonArray(router string, params interface{}, respHandler RespHandler, ...)
- func (r *HttpRequestAsync) RequestJsonMap(router string, params interface{}, respHandler RespHandler, ...)
- func (r *HttpRequestAsync) RequestPost(router string, data []byte, header map[string]string, respHandler RespHandler, ...)
- type HttpResponse
- type HttpServer
- type JsonArray
- type JsonMap
- func (this JsonMap) Get(key string) JsonObject
- func (this JsonMap) GetArray(key string) JsonArray
- func (this JsonMap) GetBool(key string) bool
- func (this JsonMap) GetErrorKeys() string
- func (this JsonMap) GetInt(key string) int
- func (this JsonMap) GetInt64(key string) int64
- func (this JsonMap) GetMap(key string) JsonMap
- func (this JsonMap) GetStr(key string) string
- func (this JsonMap) GetUint(key string) uint
- func (this JsonMap) GetUint64(key string) uint64
- func (this JsonMap) ToUrl(sb *StringBuilder)
- func (this JsonMap) WriteToHttp(writer http.ResponseWriter) error
- type JsonObject
- type JsonType
- func (this *JsonType) DataToBytes(data interface{}) ([]byte, error)
- func (this *JsonType) Marshal(obj JsonObject) ([]byte, error)
- func (this *JsonType) Unmarshal(bytes []byte) (JsonObject, error)
- func (this *JsonType) UnmarshalArray(bytes []byte) (JsonArray, error)
- func (this *JsonType) UnmarshalMap(bytes []byte) (JsonMap, error)
- type RequestAsyncRet
- type RequestHandler
- type RespErrorHandler
- type RespHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartHttpGetAsync ¶
func StartHttpGetAsync()
func StartHttpPostAsync ¶
func StartHttpPostAsync()
Types ¶
type AsyncHttpServer ¶
type AsyncHttpServer struct {
// contains filtered or unexported fields
}
func NewAsyncHttpServer ¶
func NewAsyncHttpServer() *AsyncHttpServer
func (*AsyncHttpServer) RegisterRouter ¶
func (h *AsyncHttpServer) RegisterRouter(router string, handler HttpAsyncHandler)
func (*AsyncHttpServer) StartServer ¶
func (h *AsyncHttpServer) StartServer(uri string)
func (*AsyncHttpServer) StopServer ¶
func (h *AsyncHttpServer) StopServer()
type HttpAsyncHandler ¶
type HttpAsyncHandler func(form *HttpFormAsync) interface{}
type HttpForm ¶
type HttpForm struct { Request *http.Request Response http.ResponseWriter // contains filtered or unexported fields }
======================================================================================
func (*HttpForm) HeaderValue ¶
type HttpFormAsync ¶
type HttpFormAsync struct { Resp chan interface{} HttpForm // contains filtered or unexported fields }
type HttpRequest ¶
type HttpRequest struct {
// contains filtered or unexported fields
}
var HttpGet *HttpRequest
var HttpPost *HttpRequest
func NewHttpRequest ¶
func NewHttpRequest(host string, reqType string) *HttpRequest
func (*HttpRequest) Request ¶
func (r *HttpRequest) Request(router string, params interface{}) ([]byte, error)
func (*HttpRequest) RequestGet ¶
func (*HttpRequest) RequestJsonArray ¶
func (r *HttpRequest) RequestJsonArray(router string, params interface{}) (JsonArray, error)
func (*HttpRequest) RequestJsonMap ¶
func (r *HttpRequest) RequestJsonMap(router string, params interface{}) (JsonMap, error)
func (*HttpRequest) RequestPost ¶
type HttpRequestAsync ¶
type HttpRequestAsync struct {
// contains filtered or unexported fields
}
var HttpGetAsync *HttpRequestAsync
var HttpPostAsync *HttpRequestAsync
func NewHttpRequestAsync ¶
func NewHttpRequestAsync(host string, reqType string) *HttpRequestAsync
func (*HttpRequestAsync) HandleHttpResponse ¶
func (r *HttpRequestAsync) HandleHttpResponse()
func (*HttpRequestAsync) Release ¶
func (r *HttpRequestAsync) Release()
func (*HttpRequestAsync) Request ¶
func (r *HttpRequestAsync) Request(router string, params interface{}, respHandler RespHandler, errHandler RespErrorHandler)
func (*HttpRequestAsync) RequestGet ¶
func (r *HttpRequestAsync) RequestGet(router string, header map[string]string, respHandler RespHandler, errHandler RespErrorHandler)
func (*HttpRequestAsync) RequestJsonArray ¶
func (r *HttpRequestAsync) RequestJsonArray(router string, params interface{}, respHandler RespHandler, errHandler RespErrorHandler)
func (*HttpRequestAsync) RequestJsonMap ¶
func (r *HttpRequestAsync) RequestJsonMap(router string, params interface{}, respHandler RespHandler, errHandler RespErrorHandler)
func (*HttpRequestAsync) RequestPost ¶
func (r *HttpRequestAsync) RequestPost(router string, data []byte, header map[string]string, respHandler RespHandler, errHandler RespErrorHandler)
type HttpResponse ¶
func (*HttpResponse) SetHeader ¶
func (h *HttpResponse) SetHeader(key string, value string)
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHttpServer ¶
func NewHttpServer() *HttpServer
func (*HttpServer) RegisterRouter ¶
func (h *HttpServer) RegisterRouter(router string, handler RequestHandler)
func (*HttpServer) StartServer ¶
func (h *HttpServer) StartServer(uri string)
func (*HttpServer) StopServer ¶
func (h *HttpServer) StopServer()
type JsonArray ¶
type JsonArray []interface{}
func (JsonArray) Get ¶
func (this JsonArray) Get(i int) JsonObject
======================json arrays==============================================
type JsonMap ¶
type JsonMap map[string]interface{}
func (JsonMap) Get ¶
func (this JsonMap) Get(key string) JsonObject
======================json map==============================================
func (JsonMap) GetErrorKeys ¶
func (JsonMap) WriteToHttp ¶
func (this JsonMap) WriteToHttp(writer http.ResponseWriter) error
type JsonObject ¶
type JsonObject interface{}
type JsonType ¶
type JsonType struct{}
var JsonHelper JsonType
func (*JsonType) DataToBytes ¶
func (*JsonType) UnmarshalArray ¶
type RequestAsyncRet ¶
type RequestAsyncRet struct {
// contains filtered or unexported fields
}
type RequestHandler ¶
type RequestHandler func(form *HttpForm) interface{}
type RespErrorHandler ¶
type RespErrorHandler func(err error)
type RespHandler ¶
type RespHandler func(reqResult *RequestAsyncRet)
Click to show internal directories.
Click to hide internal directories.