Documentation ¶
Index ¶
- type Body
- type BodyChunkSize
- type BodyLength
- type Headers
- type HeadersKeyLength
- type HeadersNumber
- type HeadersValuesObjectPoolSize
- type HeadersValuesSpace
- type Query
- type QueryLength
- type QueryNumber
- type ResponseBuff
- type Setting
- type Settings
- type TCPServer
- type TCPServerRead
- type URL
- type URLLength
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Body ¶
type Body struct { // Length is responsible for body length parameters. // Default value is unused. // Maximal value is a maximal length of body Length BodyLength // BodyChunkSize is responsible for chunks in chunked transfer encoding mode. // Default value is unused because chunked body parser calls callback with // data taken from input stream. // Maximal value is a maximal length of chunk ChunkSize BodyChunkSize }
type BodyChunkSize ¶
type BodyLength ¶
type Headers ¶
type Headers struct { // Number is responsible for headers map size. // Default value is an initial size of allocated headers map. // Maximal value is maximum number of headers allowed to be presented Number HeadersNumber // KeyLength is responsible for header key length. // Maximal value is a maximal length of header key KeyLength HeadersKeyLength // HeadersValuesSpace is responsible for a maximal space in bytes available for // keeping header values in memory. // Default value is initial space allocated when client connects. // Maximal value is a hard limit, reaching which one client triggers server // to response with 431 Header Fields Too Large ValueSpace HeadersValuesSpace // ValuesObjectPoolSize is responsible for a queue size in object pool of string // slices. // Maximal value is a queue size of the object pool queue size. ValuesObjectPoolSize HeadersValuesObjectPoolSize }
type HeadersKeyLength ¶
type HeadersNumber ¶
type HeadersValuesSpace ¶
type Query ¶
type Query struct { // Length is responsible for a maximal length of url query may be // received. // Default value is unused Length QueryLength // Number is responsible for an initial capacity of query entries map. // Maximal value is unused because: // Maximal number of entries equals to 65535 (math.MaxUint16) divided by // 3 (minimal length of query entry) that equals to 21,845. // Worst case: sizeof(int) == 64 and sizeof(unsafe.Pointer) == 64. Then // slice type takes 16 bytes // In that case, we can calculate how much memory AT MOST will be used. // 24 bytes (slice type - cap, len and pointer 8 bytes each) + 1 byte // (an array of a single char in best case) + 16 bytes (string type - len // and pointer) + 1 byte (an array of single char in best case) // 42 bytes in total for each pair, 917490 bytes in total, that is 896 kilobytes // that is 0.87 megabytes. IMHO that is not that much to care about. In case it // is - somebody will open an issue, or even better, implement the limit by himself // (hope he is lucky enough to find out how to handle with my hand-made DI) Number QueryNumber }
Query is responsible for url query settings.
type QueryLength ¶
type QueryNumber ¶
type ResponseBuff ¶
ResponseBuff is responsible for a response buffer. Default value is a size of buffer allocated once a client connects.
type Settings ¶
type Settings struct { Headers Headers URL URL TCPServer TCPServer Body Body ResponseBuff ResponseBuff }
type TCPServer ¶
type TCPServer struct { // Read is responsible for tcp server reading buffer settings. // Default value is a size of buffer for reading from socket, also // we can call this setting as a "how many bytes are read from // socket at most" Read TCPServerRead // IDLEConnLifetime is a timer in seconds, after expiration of which one IDLE // connection will be actively closed by server. // IDLE conn is a connection that does not send anything // -1 as value disables timeouts at all IDLEConnLifetime int }
type TCPServerRead ¶
Click to show internal directories.
Click to hide internal directories.