client

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL