Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFastHttpClient ¶
func NewFastHttpClient() *fastHttpClient
NewFastHttpClient returns a new fastHttpClient the actual construction is implemented in Init
func NewNetHttpClient ¶
func NewNetHttpClient() *netHttpClient
NewNetHttpClient returns a new netHttpClient the actual construction is implemented in Init
func NewRawHttpClient ¶
func NewRawHttpClient() *rawHttpClient
NewRawHttpClient returns a new rawHttpClient the actual construction is implemented in Init
Types ¶
type RawResponse ¶
type RawResponse struct { StatusCode int ContentLength int // contains filtered or unexported fields }
Response contains a status code, the size, content-length as well as the underlying bytes
func (*RawResponse) CanStartParse ¶
func (r *RawResponse) CanStartParse(length int) bool
CanStartParse returns whether the rawBytes given the length, contains CRLFCRLF so it can be parsed once CRLFCRLF is found, it will record the location for where the body starts
func (*RawResponse) IsBodyComplete ¶
func (r *RawResponse) IsBodyComplete(length int) bool
IsBodyComplete is used to return whether rawBytes is a complete Response given the total number of the bytes read
func (*RawResponse) Parse ¶
func (r *RawResponse) Parse()
Parse is used to parse the underlying rawBytes to get StatusCode and ContentLength
func (*RawResponse) ResetState ¶
func (r *RawResponse) ResetState()
ResetState is used to reset the Response state so it can be used for parsing a new one