aboutsummaryrefslogtreecommitdiff
path: root/args.go
AgeCommit message (Collapse)AuthorFilesLines
2023-12-13chore: Add missing dots at the end of comments (#1677)Gravatar Oleksandr Redko 1-2/+2
2023-11-24chore: Use 'any' instead of 'interface{}' (#1666)Gravatar Oleksandr Redko 1-1/+1
gofmt -w -r "interface{} -> any" -l .
2023-11-24Enable wastedassign, whitespace linters; fix issues (#1665)Gravatar Oleksandr Redko 1-1/+1
2023-08-29Enable gocritic linter; fix lint issues (#1612)Gravatar Oleksandr Redko 1-7/+9
2023-05-11Refactor by removing unnecessary else block (#1559)Gravatar Oleksandr Redko 1-2/+1
2023-04-04remove (#1534)Gravatar tyltr 1-1/+0
2023-02-11Refactor golangci-lint config and remove redundant nolints (#1486)Gravatar Oleksandr Redko 1-1/+1
* Refactor golangci-lint config - Use golangci-lint-action for GitHub workflow. - Add additional golangci-lint run options. - Remove unused nolint directives. * Revert exclude-use-default option
2022-11-14Make sure nothing is nil in tmp slice (#1423)Gravatar hs son 1-1/+2
2022-10-29feat: add PeekKeys and PeekTrailerKeys (#1405)Gravatar kinggo 1-0/+8
* feat: add PeekKeys and PeekTrailerKeys * Improve warning Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
2022-10-15feat: add header.PeekAll (#1394)Gravatar kinggo 1-0/+10
2022-06-06header.go Referer() optimize (#1313)Gravatar Sergey Ponomarev 1-1/+1
* args.go GetBool(): use switch with string casting This should be optimized by Go compiler itself so the b2s() call is not needed. It was previously done by this but changed in 1e7885eb56cdf4c6f550e143b0dbd3acc82a4137 * header.go Referer() optimize Use direct peekArgBytes() instead of PeekBytes() that will check for special headers * header_timing_test.go BenchmarkRequestHeaderPeekBytesSpecialHeader The old BenchmarkRequestHeaderPeekBytesCanonical and BenchmarkRequestHeaderPeekBytesNonCanonical are in fact just measured the header normalization. But it's anyway is benchmarked separately. Results was almost the same: 1.5 ns/op. Instead, let's reuse the benches to find a difference between peeking of special (Host, CT) and custom headers.
2022-04-24optimize (#1275)Gravatar tyltr 1-2/+17
* opotimize * lint * without min * less comparisons
2022-04-19optimize (#1272)Gravatar tyltr 1-2/+5
2022-03-18reduce unnessary type assart (#1254)Gravatar tyltr 1-1/+1
2021-12-05Add trailer support (#1165)Gravatar ichx 1-0/+7
* Add trailer support * fix issue and add documentation * remove redundant code * add error return for add/set trailer method * fix lint error * fix bad trailer error return issue and update bad content-length error * update errNonNumericChars * update errNonNumericChars * fix issue about error and fix typo
2021-10-01Improve return value reusability documentationGravatar Erik Dubbelboer 1-3/+6
2020-12-26Make argsKV more predictableGravatar Erik Dubbelboer 1-1/+9
Fixes #932
2020-11-24Fixing deletion of headers/queryargs having multiple values. (#918)Gravatar anshul-jain-aws 1-0/+1
2019-11-16Run golangci-lint using a Github ActionGravatar Erik Dubbelboer 1-1/+1
2019-02-03change timer to public api #525 (#527)Gravatar xuecai 1-1/+1
* change acquireTimer and releaseTimer to public api
2019-02-02Various changes regarding code readibility (#523)Gravatar Shulhan 1-4/+4
* all: use sort.Strings when applicable Basically, sort.Strings is the shortcut of Sort(StringSlice(a)) but its more readable. * all: replace string(bytes.Buffer.Bytes()) with bytes.Buffer.String() Although its only occured on test files, it may be worth to simplified it. * http_test: simplify strings.Index with strings.Contains Both have the same O(n), but strings.Contains more readable on if-condition. * args: simplify if-condition check on boolean value * all: simplify variable initialization If we assign the variable after declaring it, we can simplify it using ":=" operator or "= value". The reader can still known the type of variable from the struct name or variable type before assignment operator.
2019-01-04add method Sort in args (#505)v1.1.0Gravatar xuecai 1-1/+15
* add method StringSort QueryStringSort AppendBytesSort in args * simplify code * only Sort method * format * add method StringSort QueryStringSort AppendBytesSort in args * simplify code * only Sort method * format * merge and fix tests * change sort into generic by having the sort function * change sort into generic by having the sort function * change comment
2018-12-30fix args empty string be changed to boolen (#502)Gravatar xuecai 1-22/+74
Add support for empty args
2018-10-01Remove fasthttp.ByteBufferGravatar Erik Dubbelboer 1-2/+4
As advertised in https://github.com/valyala/fasthttp/commit/b5f96d4b4120bb1e09c23ac32baf21a14da4a71d
2018-08-21handle 't' and 'true' as bool in QueryArgsGravatar Erik Dubbelboer 1-3/+6
See: https://github.com/erikdubbelboer/fasthttp/pull/46
2017-10-08A lot of typo fixesGravatar xPushkin 1-1/+1
2017-07-21decodeArgAppend code prettifyingGravatar Aliaksandr Valialkin 1-6/+6
2017-07-21decodeArgAppend* optimization: remove bounds check when decoding ↵Gravatar Aliaksandr Valialkin 1-2/+2
percent-encoded string Benchmark results: name old time/op new time/op delta AppendUnquotedArgSlowPath-4 68.9ns ± 2% 63.5ns ± 2% -7.88% (p=0.000 n=10+10)
2017-07-21ioptimized decodeArgAppend a bitGravatar Aliaksandr Valialkin 1-12/+45
Benchmark results on linux/amd64: name old time/op new time/op delta ArgsParse-4 72.8ns ± 2% 68.0ns ± 2% -6.59% (p=0.000 n=10+9) AppendUnquotedArgFastPath-4 20.4ns ± 2% 21.1ns ± 9% ~ (p=0.614 n=8+10) AppendUnquotedArgSlowPath-4 68.9ns ± 3% 70.4ns ± 6% ~ (p=0.148 n=9+10) URIParsePath-4 80.9ns ± 2% 78.7ns ± 2% -2.80% (p=0.000 n=10+10) URIParsePathQueryString-4 88.9ns ± 1% 86.3ns ± 1% -2.90% (p=0.000 n=10+8) URIParsePathQueryStringHash-4 95.7ns ± 8% 91.0ns ± 1% -4.88% (p=0.000 n=9+10) URIParseHostname-4 98.6ns ± 1% 95.4ns ± 1% -3.24% (p=0.000 n=10+10)
2017-06-20use more clear decodeArgAppend instead of misleading decodeArgGravatar Aliaksandr Valialkin 1-9/+5
2017-06-20added a fast path to decodeArgAppend when the arg doesnt contain encoded charsGravatar Aliaksandr Valialkin 1-0/+6
2017-01-30Added Args.GetBool helperGravatar Aliaksandr Valialkin 1-0/+13
2016-03-29Added Args.Add()Gravatar Aliaksandr Valialkin 1-0/+28
2016-03-29Eliminated bufKV member from Args struct. This shaves off 16 bytes from ↵Gravatar Aliaksandr Valialkin 1-7/+7
RequestCtx struct
2016-03-29Pass string key to hasArg instead of byte slice keyGravatar Aliaksandr Valialkin 1-5/+4
2016-03-29Added delAllArgsBytes helperGravatar Aliaksandr Valialkin 1-5/+8
2016-03-29Renamed unsafeBytes2Str to b2sGravatar Aliaksandr Valialkin 1-9/+14
2016-03-29Renamed setArg to setArgBytesGravatar Aliaksandr Valialkin 1-2/+2
2016-03-15re-use appendArg inside setArgv20160316Gravatar Aliaksandr Valialkin 1-13/+1
2016-03-11optimized delAllArgsGravatar Aliaksandr Valialkin 1-12/+3
2016-03-10Issue #64: properly delete header values via Del callGravatar Aliaksandr Valialkin 1-1/+11
2016-03-06Moved empty noCopy struct to the top of container structs. See @stemar94 's ↵Gravatar Aliaksandr Valialkin 1-2/+2
comment at https://github.com/golang/go/issues/12884 for details
2016-03-04Do not expose noCopy.LockGravatar Aliaksandr Valialkin 1-1/+1
2016-03-04Embed noCopy struct into structs, which mustn't be copiedGravatar Aliaksandr Valialkin 1-0/+2
This should help `go vet` detecting invalid structs' copyings. See https://github.com/golang/go/issues/8005#issuecomment-190753527 for details.
2016-02-19Added AcquireArgs and ReleaseArgs helper functionsGravatar Aliaksandr Valialkin 1-0/+23
2016-02-17Issue #53: Clarify that the following instances mustn't be used from ↵Gravatar Aliaksandr Valialkin 1-2/+1
concurrently running goroutines: Args, Cookie, URI, RequestCtx, Request, Response, RequestHeader and ResponseHeader
2016-02-15Added Args.PeekMulti for obtaining multiple query arg values for the given keyGravatar Aliaksandr Valialkin 1-0/+16
2016-01-13Exported AppendQuotedArgGravatar Aliaksandr Valialkin 1-2/+2
2015-12-19Substitute EqualBytesStr(s, b) by string(b) == sGravatar Aliaksandr Valialkin 1-1/+1
2015-12-19Substitute AppendBytesStr by append()Gravatar Aliaksandr Valialkin 1-7/+7