Documentation
¶
Index ¶
- Variables
- type MongoDB
- func (db *MongoDB) CloseDB()
- func (db *MongoDB) CommitPortfolioVote(ctx context.Context, in *chan PortfolioData, i int)
- func (db *MongoDB) CreateUserFromGoth(user *goth.User) (*models.UserModel, error)
- func (db *MongoDB) FindUserByAPIKey(apiKey string) (*models.UserModel, error)
- func (db *MongoDB) FindUserByJWT(email string, provider string, userID string) (*models.UserModel, error)
- type PortfolioData
Constants ¶
This section is empty.
Variables ¶
View Source
var PortfolioChan []chan PortfolioData
Functions ¶
This section is empty.
Types ¶
type MongoDB ¶
type MongoDB struct { Session *mongo.Client Users *mongo.Collection DeletedUsers *mongo.Collection Income *mongo.Collection DeletedIncome *mongo.Collection Cost *mongo.Collection DeletedCost *mongo.Collection IncomeHistory *mongo.Collection CostHistory *mongo.Collection }
func ConnectDB ¶
func ConnectDB(cfg *utils.ServerConfig) (db *MongoDB)
ConnectDB will build connection to MongoDB Atlas
func (*MongoDB) CommitPortfolioVote ¶
func (db *MongoDB) CommitPortfolioVote(ctx context.Context, in *chan PortfolioData, i int)
implement mongodb transaction for vote income
func (*MongoDB) CreateUserFromGoth ¶
CreateUserFromGoth using data from goth to create user
func (*MongoDB) FindUserByAPIKey ¶
FindUserByAPIKey will find user related to the APIKey
type PortfolioData ¶
type PortfolioData struct { Portfolio models.PortfolioModel Voter primitive.ObjectID DB *mongo.Collection Result *chan []primitive.ObjectID }
Click to show internal directories.
Click to hide internal directories.