Documentation ¶
Index ¶
Constants ¶
View Source
const ( AuthDatabase = "sampledb" AuthUserName = "sadhal" AuthPassword = "sadhal" )
Variables ¶
View Source
var MongoDBHosts = os.Getenv("MONGODB_SERVICE_HOST") + ":" + os.Getenv("MONGODB_SERVICE_PORT")
Functions ¶
This section is empty.
Types ¶
type IMongoClient ¶
type MockMongoClient ¶
MockBoltClient is a mock implementation of a datastore client for testing purposes. Instead of the bolt.DB pointer, we're just putting a generic mock object from strechr/testify
func (*MockMongoClient) CreateUser ¶
func (*MockMongoClient) OpenMongoDb ¶
func (m *MockMongoClient) OpenMongoDb()
func (*MockMongoClient) QueryUser ¶
func (m *MockMongoClient) QueryUser(userId string) (model.User, error)
From here, we'll declare three functions that makes our MockBoltClient fulfill the interface IBoltClient that we declared in part 3.
func (*MockMongoClient) QueryUsers ¶
func (m *MockMongoClient) QueryUsers() ([]model.User, error)
type MongoClient ¶
type MongoClient struct {
// contains filtered or unexported fields
}
Real implementation
func (*MongoClient) CreateUser ¶
func (*MongoClient) OpenMongoDb ¶
func (mc *MongoClient) OpenMongoDb()
func (*MongoClient) QueryUsers ¶
func (mc *MongoClient) QueryUsers() ([]model.User, error)
Click to show internal directories.
Click to hide internal directories.