Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Body ¶
type Body struct {
// MaxSize is responsible for a maximal body size in case it is being transferred
// using ordinary Content-Length header, otherwise (e.g. chunked TE) this limit,
// unfortunately, doesn't work
MaxSize int64
// MaxChunkSize is responsible for a maximal size of a single chunk being transferred
// via chunked TE
MaxChunkSize int64
}
type HTTP ¶
type HTTP struct {
// ResponseBuffSize is responsible for a response buffer that is being allocated when
// client connects and is used for rendering the response into it
ResponseBuffSize int64
}
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
// MaxKeyLength is responsible for maximal header key length restriction.
MaxKeyLength int
// MaxValueLength is responsible for maximal header value length restriction.
MaxValueLength int
// 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
// MaxValuesObjectPoolSize is responsible for a maximal size of string slices object
// pool
MaxValuesObjectPoolSize int
}
type HeadersNumber ¶
type HeadersNumber struct {
Default, Maximal int
}
type HeadersValuesSpace ¶
type HeadersValuesSpace struct {
Default, Maximal int
}
type Query ¶
type Query struct {
// MaxLength is responsible for a limit of the query length
MaxLength int
// DefaultMapSize is responsible for an initial capacity of query entries map.
// There is no up limit because:
// Maximal number of entries equals to 65536 (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)
DefaultMapSize int
}
type URL ¶
type URL struct {
// MaxLength is a size for buffer that'll be allocated once and will be kept
// until client disconnect
BufferSize URLBufferSize
Query Query
Params URLParams
}
type URLBufferSize ¶ added in v0.8.1
type URLBufferSize struct {
Default, Maximal int
}
Click to show internal directories.
Click to hide internal directories.