Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/gobwas/httphead
/ functions
Functions
107 in github.com/gobwas/httphead
⨍
Functions
107
◇
Types & classes
19
↓ 20 callers
Method
Equal
Equal reports whether option is equal to b.
option.go:52
↓ 18 callers
Function
NewOption
NewOption creates named option with given parameters.
option.go:40
↓ 11 callers
Method
write
(p []byte)
writer.go:89
↓ 8 callers
Method
data
()
option.go:167
↓ 6 callers
Method
IsToken
IsToken reports whether octet is token.
octet.go:48
↓ 5 callers
Method
IsSpace
IsSpace reports whether octet is space (SP or HT).
octet.go:45
↓ 5 callers
Function
ScanOptions
ScanOptions parses data in this form: values = 1#value value = token *( ";" param ) param = token [ "=" (token | quoted-string) ] It calls given cal
httphead.go:195
↓ 5 callers
Method
String
String represents option as a string.
option.go:35
↓ 4 callers
Method
Bytes
Bytes returns current token bytes.
lexer.go:150
↓ 4 callers
Method
Copy
Copy copies all underlying []byte slices into p and returns new Option. Note that p must be at least of opt.Size() length.
option.go:21
↓ 4 callers
Function
ParseVersion
ParseVersion parses major and minor version of HTTP protocol. It returns parsed values and true if parse is ok.
head.go:103
↓ 4 callers
Method
Set
Set sets value by key.
option.go:130
↓ 4 callers
Method
Size
Size returns number of bytes need to be allocated for use in opt.Copy.
option.go:15
↓ 4 callers
Function
isComma
(b []byte)
httphead.go:323
↓ 4 callers
Method
resetItem
()
lexer.go:168
↓ 3 callers
Function
IntFromASCII
IntFromASCII converts ascii encoded decimal numeric value from HTTP entities to an integer.
head.go:197
↓ 3 callers
Method
Scan
Scan maps data to name and value pairs. Usually data represents value of the Cookie header.
cookie.go:49
↓ 3 callers
Function
ScanTokens
ScanTokens parses data in this form: list = 1#token It returns false if data is malformed.
httphead.go:18
↓ 3 callers
Function
memset
(dst []byte, v byte)
httphead_test.go:448
↓ 3 callers
Function
split3
(p []byte, sep byte)
head.go:248
↓ 3 callers
Function
writeTokenSanitized
writeTokenSanitized writes token as is or as quouted string if it contains non-token characters. Note that is is not expects LWS sequnces be in s, ca
writer.go:55
↓ 2 callers
Method
IsControl
IsControl reports whether octet is CTL.
octet.go:39
↓ 2 callers
Method
IsSeparator
IsSeparator reports whether octet is separator.
octet.go:42
↓ 2 callers
Method
Next
Next scans for next token. It returns true on successful scanning, and false on error or EOF.
lexer.go:44
↓ 2 callers
Function
ParseOptions
ParseOptions parses all header options and appends it to given slice of Option. It returns flag of successful (wellformed input) parsing. Note that a
httphead.go:46
↓ 2 callers
Function
RemoveByte
RemoveByte returns data without c. If c is not present in data it returns the same slice. If not, it copies data without c.
lexer.go:288
↓ 2 callers
Function
ScanUntil
ScanUntil scans for first non-escaped character c in given data. It returns index of matched c and -1 if c is not found.
lexer.go:236
↓ 2 callers
Method
Select
Select parses header data and appends it to given slice of Option. It also returns flag of successful (wellformed input) parsing.
httphead.go:111
↓ 2 callers
Method
SkipEscaped
SkipEscaped skips all bytes until first occurence of non-escaped c.
lexer.go:129
↓ 2 callers
Method
Type
Type reports current token type.
lexer.go:145
↓ 2 callers
Function
WriteOptions
WriteOptions write options list to the dest. It uses the same form as {Scan,Parse}Options functions: values = 1#value value = token *( ";" param ) par
writer.go:21
↓ 2 callers
Method
copy
(dst []byte)
option.go:178
↓ 2 callers
Function
dumpActStd
(act []cookieTuple, std []*http.Cookie)
cookie_test.go:355
↓ 2 callers
Method
fetchComment
()
lexer.go:218
↓ 2 callers
Method
fetchQuotedString
()
lexer.go:202
↓ 2 callers
Function
isSemicolon
(b []byte)
httphead.go:326
↓ 2 callers
Function
randASCII
(dst []byte)
httphead_test.go:119
↓ 2 callers
Function
trim
(p []byte)
head.go:266
↓ 1 callers
Method
Advance
Advance moves current position index at n bytes. It returns true on successful move.
lexer.go:103
↓ 1 callers
Method
Buffered
Buffered reporst how many bytes there are left to scan.
lexer.go:97
↓ 1 callers
Method
FetchUntil
FetchUntil fetches ItemOctet from current scanner position to first occurence of the c or to the end of the underlying data.
lexer.go:67
↓ 1 callers
Method
IsChar
IsChar reports whether octet is CHAR.
octet.go:36
↓ 1 callers
Function
NewScanner
NewScanner creates new RFC2616 data scanner.
lexer.go:38
↓ 1 callers
Function
ParseRequestLine
ParseRequestLine parses http request line like "GET / HTTP/1.0".
head.go:35
↓ 1 callers
Function
ParseResponseLine
ParseResponseLine parses first response line into ResponseLine struct.
head.go:72
↓ 1 callers
Method
Peek2
Peek2 reads two first bytes at current position without advancing it. If there not enough data it returs 0.
lexer.go:86
↓ 1 callers
Function
ScanPairGreedy
ScanPairGreedy scans for complete pair of opening and closing chars in greedy manner. Note that first opening byte must not be present in data.
lexer.go:253
↓ 1 callers
Function
ScanToken
ScanToken scan for next token in p. It returns length of the token and its type. It do not trim p.
lexer.go:338
↓ 1 callers
Function
SkipSpace
SkipSpace skips spaces and lws-sequences from p. It returns number ob bytes skipped.
lexer.go:317
↓ 1 callers
Function
ValidCookieName
ValidCookieName reports wheter given bytes is a valid RFC2616 "token" bytes.
cookie.go:170
↓ 1 callers
Function
ValidCookieValue
ValidCookieValue reports whether given value is a valid RFC6265 "cookie-octet" bytes. cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E ; U
cookie.go:145
↓ 1 callers
Method
fetchOctet
(c byte)
lexer.go:173
↓ 1 callers
Method
fetchToken
()
lexer.go:188
↓ 1 callers
Function
isEquality
(b []byte)
httphead.go:329
↓ 1 callers
Method
nextChar
()
lexer.go:154
↓ 1 callers
Function
optionsEqual
(a, b []Option)
httphead_test.go:386
↓ 1 callers
Function
pow
pow for integers implementation. See Donald Knuth, The Art of Computer Programming, Volume 2, Section 4.6.3
head.go:236
↓ 1 callers
Method
result
()
writer.go:99
↓ 1 callers
Function
split2
(p []byte, sep byte)
head.go:258
↓ 1 callers
Function
stripQuotes
(bts []byte)
cookie.go:179
↓ 1 callers
Function
trimLeft
(p []byte)
cookie.go:186
↓ 1 callers
Function
trimRight
(p []byte)
cookie.go:194
Function
BenchmarkParameters
(b *testing.B)
httphead_test.go:249
Function
BenchmarkParseHttpVersion
(b *testing.B)
head_test.go:154
Function
BenchmarkScanCookie
(b *testing.B)
cookie_test.go:331
Function
BenchmarkScanTokens
(b *testing.B)
httphead_test.go:109
Function
BenchmarkScannerReadComment
(b *testing.B)
lexer_test.go:146
Function
BenchmarkScannerReadString
(b *testing.B)
lexer_test.go:135
Function
BenchmarkSelectOptions
(b *testing.B)
httphead_test.go:375
Function
CanonicalizeHeaderKey
CanonicalizeHeaderKey is like standard textproto/CanonicalMIMEHeaderKey, except that it operates with slice of bytes and modifies it inplace without c
head.go:222
Method
Clone
Clone is a shorthand for making slice of opt.Size() sequenced with Copy() call.
option.go:30
Method
Copy
Copy copies all underlying []byte slices into dst and returns new Parameters. Note that dst must be at least of p.Size() length.
option.go:101
Method
Equal
Equal reports whether a equal to b.
option.go:68
Function
ExampleParseOptions
()
httphead_test.go:34
Function
ExampleParseOptionsLifetime
()
httphead_test.go:40
Function
ExampleScanOptions
()
httphead_test.go:22
Function
ExampleScanTokens
()
httphead_test.go:10
Function
ExampleWriteOptions
()
writer_test.go:10
Method
ForEach
ForEach iterates over parameters key-value pairs and calls cb for each one.
option.go:147
Method
Get
Get returns value by key and flag about existence such value.
option.go:120
Method
Len
()
option.go:191
Method
Less
(a, b int)
option.go:192
Function
ParseHeaderLine
ParseHeaderLine parses HTTP header as key-value pair. It returns parsed values and true if parse is ok.
head.go:180
Method
Peek
Peek reads byte at current position without advancing it. On end of data it returns 0.
lexer.go:77
Function
ReadLine
ReadLine reads line from br. It reads until '\n' and returns bytes without '\n' or '\r\n' at the end. It returns err if and only if line does not end
head.go:147
Function
ScanCookie
ScanCookie scans cookie pairs from data using DefaultCookieScanner.Scan() method.
cookie.go:9
Method
Size
Size returns number of bytes that needed to copy p.
option.go:94
Method
Skip
Skip skips all bytes until first occurence of c.
lexer.go:113
Function
SplitRequestLine
SplitRequestLine splits given slice of bytes into three chunks without parsing.
head.go:30
Function
SplitResponseLine
SplitResponseLine splits given slice of bytes into three chunks without parsing.
head.go:67
Method
String
String represetns flag as string.
httphead.go:66
Method
String
String represents parameters as a string.
option.go:156
Method
Swap
(a, b int)
option.go:193
Function
TestOptionCopy
(t *testing.T)
httphead_test.go:398
Function
TestParameters
(t *testing.T)
httphead_test.go:215
Function
TestParseHttpVersion
(t *testing.T)
head_test.go:140
Function
TestParseRequestLine
(t *testing.T)
head_test.go:8
Function
TestParseResponseLine
(t *testing.T)
head_test.go:68
Function
TestScanCookie
(t *testing.T)
cookie_test.go:280
Function
TestScanTokens
(t *testing.T)
httphead_test.go:85
next →
1–100 of 107, ranked by callers