Documentation ¶
Overview ¶
Package dbclient contain the required logic for communication with the database. All data operations are included.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IMongoClient ¶
type IMongoClient interface { OpenMongoDB() QueryAccount(accountID string) (model.Account, error) ListAccounts() ([]model.Account, error) Seed() }
IMongoClient is an interface for Mongo
type MockMongoClient ¶
MockMongoClient is a mock implementation of a datastore client for testing purposes.
func (*MockMongoClient) ListAccounts ¶
func (m *MockMongoClient) ListAccounts() ([]model.Account, error)
ListAccounts provides a mock for the ListAccounts function
func (*MockMongoClient) OpenMongoDB ¶
func (m *MockMongoClient) OpenMongoDB()
OpenMongoDB provides a mock for the OpenMongoDB function
func (*MockMongoClient) QueryAccount ¶
func (m *MockMongoClient) QueryAccount(accountID string) (model.Account, error)
QueryAccount provides a mock for the QueryAccount function
func (*MockMongoClient) Seed ¶
func (m *MockMongoClient) Seed()
Seed provides a mock for the Seed function
type MongoClient ¶
type MongoClient struct {
// contains filtered or unexported fields
}
MongoClient defines a mongo session
func (*MongoClient) ListAccounts ¶
func (mc *MongoClient) ListAccounts() ([]model.Account, error)
ListAccounts connectes to the database and returns all accounts
func (*MongoClient) OpenMongoDB ¶
func (mc *MongoClient) OpenMongoDB()
OpenMongoDB provides a connection to a mongoDB instance
func (*MongoClient) QueryAccount ¶
func (mc *MongoClient) QueryAccount(accountID string) (model.Account, error)
QueryAccount connects to the database and pulls back a single account based upon the accountID as provided
func (*MongoClient) Seed ¶
func (mc *MongoClient) Seed()
Seed creates a bunch of fake accounts for fun