From cc6614c474d672ad6f42f4cafcd11dace4c19e63 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Tue, 16 Aug 2016 21:42:08 -0400 Subject: [PATCH] rename back to chihaya --- cmd/{trakr => chihaya}/main.go | 14 +++++++------- example_config.yaml | 2 +- frontend/frontend.go | 2 +- frontend/http/frontend.go | 4 ++-- frontend/http/parser.go | 2 +- frontend/http/query_params.go | 2 +- frontend/http/writer.go | 4 ++-- frontend/http/writer_test.go | 2 +- frontend/udp/frontend.go | 8 ++++---- frontend/udp/parser.go | 4 ++-- frontend/udp/writer.go | 2 +- middleware/hooks.go | 2 +- middleware/middleware.go | 10 +++++----- storage/memory/peer_store.go | 4 ++-- storage/memory/peer_store_test.go | 2 +- storage/storage.go | 4 ++-- storage/storage_bench.go | 2 +- 17 files changed, 35 insertions(+), 35 deletions(-) rename cmd/{trakr => chihaya}/main.go (92%) diff --git a/cmd/trakr/main.go b/cmd/chihaya/main.go similarity index 92% rename from cmd/trakr/main.go rename to cmd/chihaya/main.go index de146ca..b828042 100644 --- a/cmd/trakr/main.go +++ b/cmd/chihaya/main.go @@ -14,10 +14,10 @@ import ( "github.com/spf13/cobra" "gopkg.in/yaml.v2" - httpfrontend "github.com/jzelinskie/trakr/frontend/http" - udpfrontend "github.com/jzelinskie/trakr/frontend/udp" - "github.com/jzelinskie/trakr/middleware" - "github.com/jzelinskie/trakr/storage/memory" + httpfrontend "github.com/chihaya/chihaya/frontend/http" + udpfrontend "github.com/chihaya/chihaya/frontend/udp" + "github.com/chihaya/chihaya/middleware" + "github.com/chihaya/chihaya/storage/memory" ) type ConfigFile struct { @@ -27,7 +27,7 @@ type ConfigFile struct { HTTPConfig httpfrontend.Config `yaml:"http"` UDPConfig udpfrontend.Config `yaml:"udp"` Storage memory.Config `yaml:"storage"` - } `yaml:"trakr"` + } `yaml:"chihaya"` } // ParseConfigFile returns a new ConfigFile given the path to a YAML @@ -64,7 +64,7 @@ func main() { var cpuProfilePath string var rootCmd = &cobra.Command{ - Use: "trakr", + Use: "chihaya", Short: "BitTorrent Tracker", Long: "A customizible, multi-protocol BitTorrent Tracker", Run: func(cmd *cobra.Command, args []string) { @@ -173,7 +173,7 @@ func main() { }, } - rootCmd.Flags().StringVar(&configFilePath, "config", "/etc/trakr.yaml", "location of configuration file") + rootCmd.Flags().StringVar(&configFilePath, "config", "/etc/chihaya.yaml", "location of configuration file") rootCmd.Flags().StringVarP(&cpuProfilePath, "cpuprofile", "", "", "location to save a CPU profile") if err := rootCmd.Execute(); err != nil { diff --git a/example_config.yaml b/example_config.yaml index 182591f..53c207c 100644 --- a/example_config.yaml +++ b/example_config.yaml @@ -1,4 +1,4 @@ -trakr: +chihaya: announce_interval: 15m prometheus_addr: localhost:6880 diff --git a/frontend/frontend.go b/frontend/frontend.go index a577d96..c2a103f 100644 --- a/frontend/frontend.go +++ b/frontend/frontend.go @@ -3,7 +3,7 @@ package frontend import ( "golang.org/x/net/context" - "github.com/jzelinskie/trakr/bittorrent" + "github.com/chihaya/chihaya/bittorrent" ) // TrackerLogic is the interface used by a frontend in order to: (1) generate a diff --git a/frontend/http/frontend.go b/frontend/http/frontend.go index f21ddf5..7439923 100644 --- a/frontend/http/frontend.go +++ b/frontend/http/frontend.go @@ -12,7 +12,7 @@ import ( "github.com/tylerb/graceful" "golang.org/x/net/context" - "github.com/jzelinskie/trakr/frontend" + "github.com/chihaya/chihaya/frontend" ) func init() { @@ -22,7 +22,7 @@ func init() { var promResponseDurationMilliseconds = prometheus.NewHistogramVec( prometheus.HistogramOpts{ - Name: "trakr_http_response_duration_milliseconds", + Name: "chihaya_http_response_duration_milliseconds", Help: "The duration of time it takes to receive and write a response to an API request", Buckets: prometheus.ExponentialBuckets(9.375, 2, 10), }, diff --git a/frontend/http/parser.go b/frontend/http/parser.go index 823fe25..7e7674a 100644 --- a/frontend/http/parser.go +++ b/frontend/http/parser.go @@ -4,7 +4,7 @@ import ( "net" "net/http" - "github.com/jzelinskie/trakr/bittorrent" + "github.com/chihaya/chihaya/bittorrent" ) // ParseAnnounce parses an bittorrent.AnnounceRequest from an http.Request. diff --git a/frontend/http/query_params.go b/frontend/http/query_params.go index 525b8e3..415b4fc 100644 --- a/frontend/http/query_params.go +++ b/frontend/http/query_params.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/jzelinskie/trakr/bittorrent" + "github.com/chihaya/chihaya/bittorrent" ) // ErrKeyNotFound is returned when a provided key has no value associated with diff --git a/frontend/http/writer.go b/frontend/http/writer.go index 0d1b100..7e0dead 100644 --- a/frontend/http/writer.go +++ b/frontend/http/writer.go @@ -3,8 +3,8 @@ package http import ( "net/http" - "github.com/jzelinskie/trakr/bittorrent" - "github.com/jzelinskie/trakr/frontend/http/bencode" + "github.com/chihaya/chihaya/bittorrent" + "github.com/chihaya/chihaya/frontend/http/bencode" ) // WriteError communicates an error to a BitTorrent client over HTTP. diff --git a/frontend/http/writer_test.go b/frontend/http/writer_test.go index 522bd5f..cb7d103 100644 --- a/frontend/http/writer_test.go +++ b/frontend/http/writer_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/jzelinskie/trakr/bittorrent" + "github.com/chihaya/chihaya/bittorrent" ) func TestWriteError(t *testing.T) { diff --git a/frontend/udp/frontend.go b/frontend/udp/frontend.go index 5a4a6b9..a4474b3 100644 --- a/frontend/udp/frontend.go +++ b/frontend/udp/frontend.go @@ -13,9 +13,9 @@ import ( "github.com/prometheus/client_golang/prometheus" "golang.org/x/net/context" - "github.com/jzelinskie/trakr/bittorrent" - "github.com/jzelinskie/trakr/frontend" - "github.com/jzelinskie/trakr/frontend/udp/bytepool" + "github.com/chihaya/chihaya/bittorrent" + "github.com/chihaya/chihaya/frontend" + "github.com/chihaya/chihaya/frontend/udp/bytepool" ) func init() { @@ -25,7 +25,7 @@ func init() { var promResponseDurationMilliseconds = prometheus.NewHistogramVec( prometheus.HistogramOpts{ - Name: "trakr_udp_response_duration_milliseconds", + Name: "chihaya_udp_response_duration_milliseconds", Help: "The duration of time it takes to receive and write a response to an API request", Buckets: prometheus.ExponentialBuckets(9.375, 2, 10), }, diff --git a/frontend/udp/parser.go b/frontend/udp/parser.go index c771a42..a73fe33 100644 --- a/frontend/udp/parser.go +++ b/frontend/udp/parser.go @@ -4,7 +4,7 @@ import ( "encoding/binary" "net" - "github.com/jzelinskie/trakr/bittorrent" + "github.com/chihaya/chihaya/bittorrent" ) const ( @@ -125,7 +125,7 @@ func handleOptionalParameters(packet []byte) (params bittorrent.Params, err erro return params, errMalformedPacket } - // TODO(jzelinskie): Actually parse the URL Data as described in BEP 41 + // TODO(chihaya): Actually parse the URL Data as described in BEP 41 // into something that fulfills the bittorrent.Params interface. optionStartIndex += 1 + length diff --git a/frontend/udp/writer.go b/frontend/udp/writer.go index 6f04d9e..6055d66 100644 --- a/frontend/udp/writer.go +++ b/frontend/udp/writer.go @@ -7,7 +7,7 @@ import ( "io" "time" - "github.com/jzelinskie/trakr/bittorrent" + "github.com/chihaya/chihaya/bittorrent" ) // WriteError writes the failure reason as a null-terminated string. diff --git a/middleware/hooks.go b/middleware/hooks.go index 1e7717b..1c5b30f 100644 --- a/middleware/hooks.go +++ b/middleware/hooks.go @@ -3,7 +3,7 @@ package middleware import ( "golang.org/x/net/context" - "github.com/jzelinskie/trakr/bittorrent" + "github.com/chihaya/chihaya/bittorrent" ) // Hook abstracts the concept of anything that needs to interact with a diff --git a/middleware/middleware.go b/middleware/middleware.go index b9b31d1..6adf4a0 100644 --- a/middleware/middleware.go +++ b/middleware/middleware.go @@ -8,9 +8,9 @@ import ( "golang.org/x/net/context" - "github.com/jzelinskie/trakr/bittorrent" - "github.com/jzelinskie/trakr/frontend" - "github.com/jzelinskie/trakr/storage" + "github.com/chihaya/chihaya/bittorrent" + "github.com/chihaya/chihaya/frontend" + "github.com/chihaya/chihaya/storage" ) type Config struct { @@ -78,7 +78,7 @@ func (l *Logic) HandleAnnounce(ctx context.Context, req *bittorrent.AnnounceRequ func (l *Logic) AfterAnnounce(ctx context.Context, req *bittorrent.AnnounceRequest, resp *bittorrent.AnnounceResponse) { for _, h := range l.announcePostHooks { if err := h.HandleAnnounce(ctx, req, resp); err != nil { - log.Println("trakr: post-announce hooks failed:", err.Error()) + log.Println("chihaya: post-announce hooks failed:", err.Error()) return } } @@ -103,7 +103,7 @@ func (l *Logic) HandleScrape(ctx context.Context, req *bittorrent.ScrapeRequest) func (l *Logic) AfterScrape(ctx context.Context, req *bittorrent.ScrapeRequest, resp *bittorrent.ScrapeResponse) { for _, h := range l.scrapePostHooks { if err := h.HandleScrape(ctx, req, resp); err != nil { - log.Println("trakr: post-scrape hooks failed:", err.Error()) + log.Println("chihaya: post-scrape hooks failed:", err.Error()) return } } diff --git a/storage/memory/peer_store.go b/storage/memory/peer_store.go index ab18273..b53aca3 100644 --- a/storage/memory/peer_store.go +++ b/storage/memory/peer_store.go @@ -8,8 +8,8 @@ import ( "sync" "time" - "github.com/jzelinskie/trakr/bittorrent" - "github.com/jzelinskie/trakr/storage" + "github.com/chihaya/chihaya/bittorrent" + "github.com/chihaya/chihaya/storage" ) // Config holds the configuration of a memory PeerStore. diff --git a/storage/memory/peer_store_test.go b/storage/memory/peer_store_test.go index d85be46..677fd53 100644 --- a/storage/memory/peer_store_test.go +++ b/storage/memory/peer_store_test.go @@ -3,7 +3,7 @@ package memory import ( "testing" - s "github.com/jzelinskie/trakr/storage" + s "github.com/chihaya/chihaya/storage" ) func createNew() s.PeerStore { diff --git a/storage/storage.go b/storage/storage.go index fe0618b..9e23676 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -1,8 +1,8 @@ package storage import ( - "github.com/jzelinskie/trakr/bittorrent" - "github.com/jzelinskie/trakr/stopper" + "github.com/chihaya/chihaya/bittorrent" + "github.com/chihaya/chihaya/stopper" ) // ErrResourceDoesNotExist is the error returned by all delete methods in the diff --git a/storage/storage_bench.go b/storage/storage_bench.go index 70429ae..1f0a225 100644 --- a/storage/storage_bench.go +++ b/storage/storage_bench.go @@ -7,7 +7,7 @@ import ( "sync/atomic" "testing" - "github.com/jzelinskie/trakr/bittorrent" + "github.com/chihaya/chihaya/bittorrent" ) type benchData struct {