Add interface for loading data from storage

This commit is contained in:
Justin Li
2013-09-06 21:38:56 -04:00
parent eff8e70cde
commit 7e402b162f
6 changed files with 119 additions and 35 deletions

View File

@@ -11,7 +11,6 @@ import (
"fmt"
"github.com/pushrax/chihaya/config"
"github.com/pushrax/chihaya/models"
"github.com/pushrax/chihaya/storage"
_ "github.com/bmizerany/pq"
@@ -48,7 +47,7 @@ func (c *Conn) Start() error {
return nil
}
func (c *Conn) RecordAnnounce(delta *models.AnnounceDelta) error {
func (c *Conn) RecordAnnounce(delta *storage.AnnounceDelta) error {
return nil
}

25
storage/batter/load.go Normal file
View File

@@ -0,0 +1,25 @@
// Copyright 2013 The Chihaya Authors. All rights reserved.
// Use of this source code is governed by the BSD 2-Clause license,
// which can be found in the LICENSE file.
package batter
import (
"github.com/pushrax/chihaya/models"
)
func (c *Conn) LoadTorrents(ids []uint64) ([]*models.Torrent, error) {
return nil, nil
}
func (c *Conn) LoadAllTorrents() ([]*models.Torrent, error) {
return nil, nil
}
func (c *Conn) LoadUsers(ids []uint64) ([]*models.User, error) {
return nil, nil
}
func (c *Conn) LoadAllUsers(ids []uint64) ([]*models.User, error) {
return nil, nil
}