diff --git a/server.go b/server.go deleted file mode 100644 index 8361a6b..0000000 --- a/server.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2016 Jimmy Zelinskie -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package trakr - -type Server struct { - HTTPConfig http.Config - UDPConfig udp.Config - Interval time.Duration - PreHooks []string - PostHooks []string - - udpserver -} - -func (s *Server) ListenAndServe() error { -} diff --git a/tracker.go b/tracker.go new file mode 100644 index 0000000..4cc86cb --- /dev/null +++ b/tracker.go @@ -0,0 +1,38 @@ +// Copyright 2016 Jimmy Zelinskie +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package trakr implements a BitTorrent Tracker that supports multiple +// protocols and configurable Hooks that execute before and after a Response +// has been delievered to a BitTorrent client. +package trakr + +// MultiTracker is a multi-protocol, customizable BitTorrent Tracker. +type MultiTracker struct { + HTTPConfig http.Config + UDPConfig udp.Config + AnnounceInterval time.Duration + GCInterval time.Duration + GCExpiration time.Duration + PreHooks []Hook + PostHooks []Hook + + httpTracker http.Tracker + udpTracker udp.Tracker +} + +// ListenAndServe listens on the protocols and addresses specified in the +// HTTPConfig and UDPConfig then blocks serving BitTorrent requests until +// t.Stop() is called or an error is returned. +func (t *MultiTracker) ListenAndServe() error { +}