Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: go
go:
- 1.12.4
- 1.12.5
- tip
matrix:
allow_failures:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# pkg
![Project status](https://img.shields.io/badge/version-3.0.1-green.svg)
![Project status](https://img.shields.io/badge/version-3.1.0-green.svg)
[![Build Status](https://travis-ci.org/go-playground/pkg.svg?branch=master)](https://travis-ci.org/go-playground/pkg)
[![Coverage Status](https://coveralls.io/repos/github/go-playground/pkg/badge.svg?branch=master)](https://coveralls.io/github/go-playground/pkg?branch=master)
[![GoDoc](https://godoc.org/github.com/go-playground/pkg?status.svg)](https://godoc.org/github.com/go-playground/pkg)
Expand Down
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
module github.com/go-playground/pkg

go 1.11

require (
github.com/go-playground/form v3.1.4+incompatible
gopkg.in/go-playground/assert.v1 v1.2.1
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github.com/go-playground/form v3.1.4+incompatible h1:lvKiHVxE2WvzDIoyMnWcjyiBxKt2+uFJyZcPYWsLnjI=
github.com/go-playground/form v3.1.4+incompatible/go.mod h1:lhcKXfTuhRtIZCIKUeJ0b5F207aeQCPbZU09ScKjwWg=
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
11 changes: 11 additions & 0 deletions net/http/accept_encodings.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package httpext

// Accept-Encoding values
const (
Gzip string = "gzip"
Compress string = "compress"
Deflate string = "deflate"
Br string = "br"
Identity string = "identity"
Any string = "*"
)
7 changes: 7 additions & 0 deletions net/http/charset.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package httpext

// Charset values
const (
UTF8 string = "utf-8"
ISO88591 string = "iso-8859-1"
)
17 changes: 17 additions & 0 deletions net/http/form.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package httpext

import (
"net/url"

"github.com/go-playground/form"
)

// FormDecoder is the type used for decoding a form for use
type FormDecoder interface {
Decode(interface{}, url.Values) error
}

var (
// DefaultDecoder of this package, which is configurable
DefaultDecoder FormDecoder = form.NewDecoder()
)
76 changes: 76 additions & 0 deletions net/http/headers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package httpext

// HTTP Header keys
const (
Age string = "Age"
AltSCV string = "Alt-Svc"
Accept string = "Accept"
AcceptCharset string = "Accept-Charset"
AcceptPatch string = "Accept-Patch"
AcceptRanges string = "Accept-Ranges"
AcceptedLanguage string = "Accept-Language"
AcceptEncoding string = "Accept-Encoding"
Authorization string = "Authorization"
CrossOriginResourcePolicy string = "Cross-Origin-Resource-Policy"
CacheControl string = "Cache-Control"
Connection string = "Connection"
ContentDisposition string = "Content-Disposition"
ContentEncoding string = "Content-Encoding"
ContentLength string = "Content-Length"
ContentType string = "Content-Type"
ContentLanguage string = "Content-Language"
ContentLocation string = "Content-Location"
ContentRange string = "Content-Range"
Date string = "Date"
DeltaBase string = "Delta-Base"
ETag string = "ETag"
Expires string = "Expires"
Host string = "Host"
IM string = "IM"
IfMatch string = "If-Match"
IfModifiedSince string = "If-Modified-Since"
IfNoneMatch string = "If-None-Match"
IfRange string = "If-Range"
IfUnmodifiedSince string = "If-Unmodified-Since"
KeepAlive string = "Keep-Alive"
LastModified string = "Last-Modified"
Link string = "Link"
Pragma string = "Pragma"
ProxyAuthenticate string = "Proxy-Authenticate"
ProxyAuthorization string = "Proxy-Authorization"
PublicKeyPins string = "Public-Key-Pins"
RetryAfter string = "Retry-After"
Referer string = "Referer"
Server string = "Server"
SetCookie string = "Set-Cookie"
StrictTransportSecurity string = "Strict-Transport-Security"
Trailer string = "Trailer"
TK string = "Tk"
TransferEncoding string = "Transfer-Encoding"
Location string = "Location"
Upgrade string = "Upgrade"
Vary string = "Vary"
Via string = "Via"
Warning string = "Warning"
WWWAuthenticate string = "WWW-Authenticate"
XForwardedFor string = "X-Forwarded-For"
XForwardedHost string = "X-Forwarded-Host"
XForwardedProto string = "X-Forwarded-Proto"
XRealIP string = "X-Real-Ip"
XContentTypeOptions string = "X-Content-Type-Options"
XFrameOptions string = "X-Frame-Options"
XXSSProtection string = "X-XSS-Protection"
XDNSPrefetchControl string = "X-DNS-Prefetch-Control"
Allow string = "Allow"
Origin string = "Origin"
AccessControlAllowOrigin string = "Access-Control-Allow-Origin"
AccessControlAllowCredentials string = "Access-Control-Allow-Credentials"
AccessControlAllowHeaders string = "Access-Control-Allow-Headers"
AccessControlAllowMethods string = "Access-Control-Allow-Methods"
AccessControlExposeHeaders string = "Access-Control-Expose-Headers"
AccessControlMaxAge string = "Access-Control-Max-Age"
AccessControlRequestHeaders string = "Access-Control-Request-Headers"
AccessControlRequestMethod string = "Access-Control-Request-Method"
TimingAllowOrigin string = "Timing-Allow-Origin"
UserAgent string = "User-Agent"
)
Loading