Storage API matured, docs, tests & more

This commit is contained in:
Jimmy Zelinskie
2013-07-05 06:50:52 -04:00
parent 279c78192f
commit 5cb4e2fabb
11 changed files with 199 additions and 157 deletions

View File

@@ -19,7 +19,7 @@ import (
func (s *Server) serveScrape(w http.ResponseWriter, r *http.Request) {
passkey, _ := path.Split(r.URL.Path)
_, err := validatePasskey(passkey, s.storage)
_, err := s.validatePasskey(passkey)
if err != nil {
fail(err, w, r)
return
@@ -35,7 +35,7 @@ func (s *Server) serveScrape(w http.ResponseWriter, r *http.Request) {
bencode(w, "files")
if pq.infohashes != nil {
for _, infohash := range pq.infohashes {
torrent, exists, err := s.storage.FindTorrent(infohash)
torrent, exists, err := s.dataStore.FindTorrent(infohash)
if err != nil {
log.Panicf("server: %s", err)
}
@@ -45,7 +45,7 @@ func (s *Server) serveScrape(w http.ResponseWriter, r *http.Request) {
}
}
} else if infohash, exists := pq.params["info_hash"]; exists {
torrent, exists, err := s.storage.FindTorrent(infohash)
torrent, exists, err := s.dataStore.FindTorrent(infohash)
if err != nil {
log.Panicf("server: %s", err)
}