-
Notifications
You must be signed in to change notification settings - Fork 1
/
doc.go
48 lines (46 loc) · 1.22 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Package negotiator is an HTTP content negotiator for Go.
//
// Accept:
//
// // Assume that the Accept header is "text/html, application/*;q=0.9, image/jpeg;q=0.8"
// negotiator.Accept([]string{"text/html", "application/json", "image/jpeg"})
// // -> "text/html"
//
// negotiator.Accept([]string{"application/json", "image/jpeg", "text/plain"})
// // -> "application/json"
//
// negotiator.Accept([]string{"text/plain"})
// // -> ""
//
// Encoding:
//
// // Assume that the Accept-Encoding header is "gzip, compress;q=0.2, identity;q=0.5"
//
// negotiator.Encoding([]string{"identity", "gzip"})
// // -> "gzip"
//
// negotiator.Encoding([]string{"compress", "identity"})
// // -> "identity"
//
// Language:
//
// // Assume that the Accept-Language header is "en;q=0.8, es, pt"
//
// negotiator.Language([]string{"en", "es", "fr"})
// // -> "es"
//
// negotiator.Language([]string{"es", "pt"})
// // -> "es"
//
// Charset:
//
// // Assume that the Accept-Charset header is "utf-8, iso-8859-1;q=0.8, utf-7;q=0.2"
//
// negotiator.Charset([]string{"utf-8", "iso-8859-1", "iso-8859-5"})
// // -> "utf-8"
//
// negotiator.Charset([]string{"iso-8859-5"})
// // -> ""
package negotiator
// Version is this package's version
const Version = "1.0.0"