Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
TestDB *testDB // singleton
)
Functions ¶
func NewTestDBMongo ¶
func NewTestDBMongo(m *MongoDB) *testDB
Using a MongoDB backend, export a testing database (done so we don't have to export the testDB struct).
Types ¶
type MockStorage ¶
func NewMockStorage ¶
func NewMockStorage() *MockStorage
func (*MockStorage) CloseConnection ¶
func (m *MockStorage) CloseConnection()
func (*MockStorage) InsertRecord ¶
func (m *MockStorage) InsertRecord(key string, url string, collection string) (err error)
func (*MockStorage) OpenConnection ¶
func (m *MockStorage) OpenConnection() (err error)
func (*MockStorage) String ¶
func (m *MockStorage) String() string
type MongoDB ¶
type MongoDB struct {
Host, Port string
Database string
Username, Password string
// contains filtered or unexported fields
}
func (*MongoDB) CloneSession ¶
func (m *MongoDB) CloneSession() (session *mgo.Session)
func (*MongoDB) InsertRecord ¶
Insert a new index record into the database.
func (*MongoDB) OpenConnection ¶
Open a MongoDB connection.
type MongoDBError ¶
type MongoDBError string
func (MongoDBError) Error ¶
func (e MongoDBError) Error() string
type ReverseIndex ¶
type ReverseIndex struct { ID bson.ObjectId `bson:"_id,omitempty"` Key string `bson:"key"` // URLs are a list for now, eventually each will be a (weighted) element // so a proper index ranking can be made URLs []string `bson:"urls"` }
A reverse index representation of a bson MongoDB object.
Click to show internal directories.
Click to hide internal directories.