From ae18d89627a99a7580e323002162c4634ea88eee Mon Sep 17 00:00:00 2001 From: Leo Balduf Date: Tue, 9 Aug 2016 15:01:36 -0400 Subject: [PATCH] rename frontends to frontend --- backend/backend.go | 4 ++-- cmd/trakr/main.go | 4 ++-- frontends/frontends.go => frontend/frontend.go | 2 +- {frontends => frontend}/http/bencode/bencode.go | 0 {frontends => frontend}/http/bencode/decoder.go | 0 {frontends => frontend}/http/bencode/decoder_test.go | 0 {frontends => frontend}/http/bencode/encoder.go | 0 {frontends => frontend}/http/bencode/encoder_test.go | 0 {frontends => frontend}/http/frontend.go | 6 +++--- {frontends => frontend}/http/parser.go | 0 {frontends => frontend}/http/query_params.go | 0 {frontends => frontend}/http/query_params_test.go | 0 {frontends => frontend}/http/writer.go | 2 +- {frontends => frontend}/http/writer_test.go | 0 {frontends => frontend}/udp/bytepool/bytepool.go | 0 {frontends => frontend}/udp/connection_id.go | 0 {frontends => frontend}/udp/connection_id_test.go | 0 {frontends => frontend}/udp/frontend.go | 8 ++++---- {frontends => frontend}/udp/parser.go | 0 {frontends => frontend}/udp/writer.go | 0 20 files changed, 13 insertions(+), 13 deletions(-) rename frontends/frontends.go => frontend/frontend.go (98%) rename {frontends => frontend}/http/bencode/bencode.go (100%) rename {frontends => frontend}/http/bencode/decoder.go (100%) rename {frontends => frontend}/http/bencode/decoder_test.go (100%) rename {frontends => frontend}/http/bencode/encoder.go (100%) rename {frontends => frontend}/http/bencode/encoder_test.go (100%) rename {frontends => frontend}/http/frontend.go (97%) rename {frontends => frontend}/http/parser.go (100%) rename {frontends => frontend}/http/query_params.go (100%) rename {frontends => frontend}/http/query_params_test.go (100%) rename {frontends => frontend}/http/writer.go (98%) rename {frontends => frontend}/http/writer_test.go (100%) rename {frontends => frontend}/udp/bytepool/bytepool.go (100%) rename {frontends => frontend}/udp/connection_id.go (100%) rename {frontends => frontend}/udp/connection_id_test.go (100%) rename {frontends => frontend}/udp/frontend.go (97%) rename {frontends => frontend}/udp/parser.go (100%) rename {frontends => frontend}/udp/writer.go (100%) diff --git a/backend/backend.go b/backend/backend.go index bea1d6c..1d97b02 100644 --- a/backend/backend.go +++ b/backend/backend.go @@ -20,7 +20,7 @@ package backend import ( "time" - "github.com/jzelinskie/trakr/frontends" + "github.com/jzelinskie/trakr/frontend" ) // GenericConfig is a block of configuration who's structure is unknown. @@ -42,6 +42,6 @@ func New(config BackendConfig, peerStore PeerStore) (*Backend, error) { // Backend is a multi-protocol, customizable BitTorrent Tracker. type Backend struct { - TrackerFuncs frontends.TrackerFuncs + TrackerFuncs frontend.TrackerFuncs peerStore PeerStore } diff --git a/cmd/trakr/main.go b/cmd/trakr/main.go index 5f0590b..d8cd4fc 100644 --- a/cmd/trakr/main.go +++ b/cmd/trakr/main.go @@ -16,8 +16,8 @@ import ( "github.com/jzelinskie/trakr/backend" - httpfrontend "github.com/jzelinskie/trakr/frontends/http" - udpfrontend "github.com/jzelinskie/trakr/frontends/udp" + httpfrontend "github.com/jzelinskie/trakr/frontend/http" + udpfrontend "github.com/jzelinskie/trakr/frontend/udp" ) type ConfigFile struct { diff --git a/frontends/frontends.go b/frontend/frontend.go similarity index 98% rename from frontends/frontends.go rename to frontend/frontend.go index 4004a02..f445d99 100644 --- a/frontends/frontends.go +++ b/frontend/frontend.go @@ -1,4 +1,4 @@ -package frontends +package frontend import ( "github.com/jzelinskie/trakr/bittorrent" diff --git a/frontends/http/bencode/bencode.go b/frontend/http/bencode/bencode.go similarity index 100% rename from frontends/http/bencode/bencode.go rename to frontend/http/bencode/bencode.go diff --git a/frontends/http/bencode/decoder.go b/frontend/http/bencode/decoder.go similarity index 100% rename from frontends/http/bencode/decoder.go rename to frontend/http/bencode/decoder.go diff --git a/frontends/http/bencode/decoder_test.go b/frontend/http/bencode/decoder_test.go similarity index 100% rename from frontends/http/bencode/decoder_test.go rename to frontend/http/bencode/decoder_test.go diff --git a/frontends/http/bencode/encoder.go b/frontend/http/bencode/encoder.go similarity index 100% rename from frontends/http/bencode/encoder.go rename to frontend/http/bencode/encoder.go diff --git a/frontends/http/bencode/encoder_test.go b/frontend/http/bencode/encoder_test.go similarity index 100% rename from frontends/http/bencode/encoder_test.go rename to frontend/http/bencode/encoder_test.go diff --git a/frontends/http/frontend.go b/frontend/http/frontend.go similarity index 97% rename from frontends/http/frontend.go rename to frontend/http/frontend.go index 3702f94..4e3e5d7 100644 --- a/frontends/http/frontend.go +++ b/frontend/http/frontend.go @@ -26,7 +26,7 @@ import ( "github.com/tylerb/graceful" "golang.org/x/net/context" - "github.com/jzelinskie/trakr/frontends" + "github.com/jzelinskie/trakr/frontend" ) func init() { @@ -71,12 +71,12 @@ type Config struct { type Frontend struct { grace *graceful.Server - frontends.TrackerFuncs + frontend.TrackerFuncs Config } // NewFrontend allocates a new instance of a Frontend. -func NewFrontend(funcs frontends.TrackerFuncs, cfg Config) *Frontend { +func NewFrontend(funcs frontend.TrackerFuncs, cfg Config) *Frontend { return &Frontend{ TrackerFuncs: funcs, Config: cfg, diff --git a/frontends/http/parser.go b/frontend/http/parser.go similarity index 100% rename from frontends/http/parser.go rename to frontend/http/parser.go diff --git a/frontends/http/query_params.go b/frontend/http/query_params.go similarity index 100% rename from frontends/http/query_params.go rename to frontend/http/query_params.go diff --git a/frontends/http/query_params_test.go b/frontend/http/query_params_test.go similarity index 100% rename from frontends/http/query_params_test.go rename to frontend/http/query_params_test.go diff --git a/frontends/http/writer.go b/frontend/http/writer.go similarity index 98% rename from frontends/http/writer.go rename to frontend/http/writer.go index 0565fc3..36ea1cd 100644 --- a/frontends/http/writer.go +++ b/frontend/http/writer.go @@ -18,7 +18,7 @@ import ( "net/http" "github.com/jzelinskie/trakr/bittorrent" - "github.com/jzelinskie/trakr/frontends/http/bencode" + "github.com/jzelinskie/trakr/frontend/http/bencode" ) // WriteError communicates an error to a BitTorrent client over HTTP. diff --git a/frontends/http/writer_test.go b/frontend/http/writer_test.go similarity index 100% rename from frontends/http/writer_test.go rename to frontend/http/writer_test.go diff --git a/frontends/udp/bytepool/bytepool.go b/frontend/udp/bytepool/bytepool.go similarity index 100% rename from frontends/udp/bytepool/bytepool.go rename to frontend/udp/bytepool/bytepool.go diff --git a/frontends/udp/connection_id.go b/frontend/udp/connection_id.go similarity index 100% rename from frontends/udp/connection_id.go rename to frontend/udp/connection_id.go diff --git a/frontends/udp/connection_id_test.go b/frontend/udp/connection_id_test.go similarity index 100% rename from frontends/udp/connection_id_test.go rename to frontend/udp/connection_id_test.go diff --git a/frontends/udp/frontend.go b/frontend/udp/frontend.go similarity index 97% rename from frontends/udp/frontend.go rename to frontend/udp/frontend.go index 424b3ff..f916e3c 100644 --- a/frontends/udp/frontend.go +++ b/frontend/udp/frontend.go @@ -28,8 +28,8 @@ import ( "golang.org/x/net/context" "github.com/jzelinskie/trakr/bittorrent" - "github.com/jzelinskie/trakr/frontends" - "github.com/jzelinskie/trakr/frontends/udp/bytepool" + "github.com/jzelinskie/trakr/frontend" + "github.com/jzelinskie/trakr/frontend/udp/bytepool" ) func init() { @@ -74,12 +74,12 @@ type Frontend struct { closing chan struct{} wg sync.WaitGroup - frontends.TrackerFuncs + frontend.TrackerFuncs Config } // NewFrontend allocates a new instance of a Frontend. -func NewFrontend(funcs frontends.TrackerFuncs, cfg Config) *Frontend { +func NewFrontend(funcs frontend.TrackerFuncs, cfg Config) *Frontend { return &Frontend{ closing: make(chan struct{}), TrackerFuncs: funcs, diff --git a/frontends/udp/parser.go b/frontend/udp/parser.go similarity index 100% rename from frontends/udp/parser.go rename to frontend/udp/parser.go diff --git a/frontends/udp/writer.go b/frontend/udp/writer.go similarity index 100% rename from frontends/udp/writer.go rename to frontend/udp/writer.go