From cd8fbf6f7fc2a338917329d0ab678da731b09cec Mon Sep 17 00:00:00 2001 From: Janos Guljas Date: Sun, 30 Jul 2017 18:24:24 +0200 Subject: [PATCH] Rename root package from httputils to web --- .travis.yml | 6 +++--- README.md | 6 +++--- auth.go | 2 +- auth_test.go | 2 +- chain.go | 2 +- chain_test.go | 2 +- client/api/api_client.go | 2 +- client/http/http_client.go | 2 +- client/http/http_client_test.go | 2 +- file-server/server.go | 2 +- form.go | 2 +- form_test.go | 2 +- https_redirect.go | 2 +- https_redirect_test.go | 2 +- log/access/access_log.go | 2 +- max_body_bytes.go | 2 +- max_body_bytes_test.go | 2 +- method.go | 2 +- method_test.go | 2 +- request.go | 2 +- request_test.go | 2 +- servers/grpc/grpc.go | 2 +- servers/grpc/grpc_test.go | 2 +- servers/http/http.go | 2 +- servers/servers.go | 3 +-- set_headers.go | 2 +- set_headers_test.go | 2 +- static_files.go | 2 +- static_files_test.go | 2 +- tcp_listeners.go | 2 +- 30 files changed, 34 insertions(+), 35 deletions(-) diff --git a/.travis.yml b/.travis.yml index dd46bf2..ba7c23d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,10 @@ go: - 1.8.1 install: - - go get -v resenje.org/httputils/... + - go get -v resenje.org/web/... before_script: - - go vet -v resenje.org/httputils/... + - go vet -v resenje.org/web/... script: - - go test -v resenje.org/httputils/... + - go test -v resenje.org/web/... diff --git a/README.md b/README.md index ea26ca0..3829199 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # A collection of HTTP utilities for Go -[![GoDoc](https://godoc.org/resenje.org/httputils?status.svg)](https://godoc.org/resenje.org/httputils) -[![Build Status](https://travis-ci.org/janos/httputils.svg?branch=master)](https://travis-ci.org/janos/httputils) +[![GoDoc](https://godoc.org/resenje.org/web?status.svg)](https://godoc.org/resenje.org/web) +[![Build Status](https://travis-ci.org/janos/web.svg?branch=master)](https://travis-ci.org/janos/web) ## Installation -Run `go get resenje.org/httputils` from command line. +Run `go get resenje.org/web` from command line. diff --git a/auth.go b/auth.go index e781881..401cd55 100644 --- a/auth.go +++ b/auth.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web import ( "bytes" diff --git a/auth_test.go b/auth_test.go index 30bb9a7..05df266 100644 --- a/auth_test.go +++ b/auth_test.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web import ( "context" diff --git a/chain.go b/chain.go index d0d4452..2aa6b30 100644 --- a/chain.go +++ b/chain.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils // import "resenje.org/httputils" +package web import "net/http" diff --git a/chain_test.go b/chain_test.go index 872a708..697dbfe 100644 --- a/chain_test.go +++ b/chain_test.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web import ( "io/ioutil" diff --git a/client/api/api_client.go b/client/api/api_client.go index ed94d3b..0c21a6c 100644 --- a/client/api/api_client.go +++ b/client/api/api_client.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package apiClient // import "resenje.org/httputils/client/api" +package apiClient import ( "bytes" diff --git a/client/http/http_client.go b/client/http/http_client.go index b253b30..fc2aa5f 100644 --- a/client/http/http_client.go +++ b/client/http/http_client.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httpClient // import "resenje.org/httputils/client/http" +package httpClient import ( "crypto/tls" diff --git a/client/http/http_client_test.go b/client/http/http_client_test.go index 3b53e72..a4eb95a 100644 --- a/client/http/http_client_test.go +++ b/client/http/http_client_test.go @@ -111,7 +111,7 @@ func TestClientRetryFailure(t *testing.T) { } func TestClientRedirectHeaders(t *testing.T) { - want := "test httputils" + want := "test web" ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.URL.Path == "/redirect" { http.Redirect(w, r, "/", http.StatusFound) diff --git a/file-server/server.go b/file-server/server.go index cbe358b..61b0c41 100644 --- a/file-server/server.go +++ b/file-server/server.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package fileServer // import "resenje.org/httputils/file-server" +package fileServer import ( "net/http" diff --git a/form.go b/form.go index 1ffd61c..b5c38c9 100644 --- a/form.go +++ b/form.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web // FormErrors represent structure errors returned by API server to // request based on HTML form data. diff --git a/form_test.go b/form_test.go index 6edcdec..f31bd8d 100644 --- a/form_test.go +++ b/form_test.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web import "testing" diff --git a/https_redirect.go b/https_redirect.go index c077b36..2a31ebf 100644 --- a/https_redirect.go +++ b/https_redirect.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web import ( "crypto/tls" diff --git a/https_redirect_test.go b/https_redirect_test.go index a23cad7..8223ba1 100644 --- a/https_redirect_test.go +++ b/https_redirect_test.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web import ( "crypto/tls" diff --git a/log/access/access_log.go b/log/access/access_log.go index b4a0bf6..fad823c 100644 --- a/log/access/access_log.go +++ b/log/access/access_log.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package accessLog // import "resenje.org/httputils/log/access" +package accessLog import ( "net/http" diff --git a/max_body_bytes.go b/max_body_bytes.go index e3f90ce..0c0332a 100644 --- a/max_body_bytes.go +++ b/max_body_bytes.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web import ( "fmt" diff --git a/max_body_bytes_test.go b/max_body_bytes_test.go index b48b97f..34933cc 100644 --- a/max_body_bytes_test.go +++ b/max_body_bytes_test.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web import ( "bytes" diff --git a/method.go b/method.go index a23741c..c0c17d0 100644 --- a/method.go +++ b/method.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web import ( "fmt" diff --git a/method_test.go b/method_test.go index 7b95e78..b146dda 100644 --- a/method_test.go +++ b/method_test.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web import ( "net/http" diff --git a/request.go b/request.go index 29d5ff4..0b002e7 100644 --- a/request.go +++ b/request.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web import ( "net" diff --git a/request_test.go b/request_test.go index b890a4c..0e8bcb5 100644 --- a/request_test.go +++ b/request_test.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web import ( "net/http/httptest" diff --git a/servers/grpc/grpc.go b/servers/grpc/grpc.go index 9da14b1..1115b89 100644 --- a/servers/grpc/grpc.go +++ b/servers/grpc/grpc.go @@ -12,7 +12,7 @@ import ( ) // Server wraps grpc.Server to provide methods for -// resenje.org/httputils/servers.Server interface. +// resenje.org/web/servers.Server interface. type Server struct { *grpc.Server } diff --git a/servers/grpc/grpc_test.go b/servers/grpc/grpc_test.go index 9459dc6..50a9287 100644 --- a/servers/grpc/grpc_test.go +++ b/servers/grpc/grpc_test.go @@ -13,7 +13,7 @@ import ( "golang.org/x/net/context" "google.golang.org/grpc" - "resenje.org/httputils/servers/grpc/internal/hello" + "resenje.org/web/servers/grpc/internal/hello" ) type server struct{} diff --git a/servers/http/http.go b/servers/http/http.go index 53b428d..2b77adb 100644 --- a/servers/http/http.go +++ b/servers/http/http.go @@ -27,7 +27,7 @@ type Option func(*Options) func WithTLSConfig(tlsConfig *tls.Config) Option { return func(o *Options) { o.tlsConfig = tlsConfig } } // Server wraps http.Server to provide methods for -// resenje.org/httputils/servers.Server interface. +// resenje.org/web/servers.Server interface. type Server struct { http.Server } diff --git a/servers/servers.go b/servers/servers.go index 34b40f8..d5ecf27 100644 --- a/servers/servers.go +++ b/servers/servers.go @@ -31,8 +31,7 @@ func (l stdLogger) Errorf(format string, a ...interface{}) { log.Printf("ERROR "+format, a...) } -// Option is a function that sets optional parameters for -// the Serve function. +// Option is a function that sets optional parameters for Servers. type Option func(*Servers) // WithLogger sets the Logger instance for logging messages. diff --git a/set_headers.go b/set_headers.go index c5ff089..d355245 100644 --- a/set_headers.go +++ b/set_headers.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web import "net/http" diff --git a/set_headers_test.go b/set_headers_test.go index fc2a2fd..6896b6f 100644 --- a/set_headers_test.go +++ b/set_headers_test.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web import ( "net/http" diff --git a/static_files.go b/static_files.go index 90e1875..56a9885 100644 --- a/static_files.go +++ b/static_files.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web import ( "net/http" diff --git a/static_files_test.go b/static_files_test.go index c399571..320427f 100644 --- a/static_files_test.go +++ b/static_files_test.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web import ( "io/ioutil" diff --git a/tcp_listeners.go b/tcp_listeners.go index d4b48ef..167313f 100644 --- a/tcp_listeners.go +++ b/tcp_listeners.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package httputils +package web import ( "net"