Documentation ¶
Index ¶
- Variables
- func ChangeChatroomOwner(newOwnerId string, chatroomId string) error
- func DeleteOneChatroomCollection(chatroomID string) error
- func FindOneChatroomCollection(chatroomID string) (*models.Chatroom, error)
- func FindOneUserCollection(id string) (*models.UserMongo, error)
- func InsertOneChatroomCollection(chatroomMongo models.Chatroom) (*mongo.InsertOneResult, error)
- func InsertOneUserCollection(user_mongo models.UserMongo) (*mongo.InsertOneResult, error)
- func IsChatroomOwner(userID string, chatroomID string) (bool, error)
- func PopChatroomInUserCollection(userID string, chatroomID string) error
- func PopUserInChatroomCollection(userID string, chatroomID string) error
- func SetupMongoDB() error
- type MongoEntity
- type MongoORM
Constants ¶
This section is empty.
Variables ¶
View Source
var ChatroomCollection *mongo.Collection
Collections: Add your collection global var here
View Source
var UserCollection *mongo.Collection
Functions ¶
func ChangeChatroomOwner ¶
func InsertOneChatroomCollection ¶
func InsertOneChatroomCollection(chatroomMongo models.Chatroom) (*mongo.InsertOneResult, error)
func InsertOneUserCollection ¶
func InsertOneUserCollection(user_mongo models.UserMongo) (*mongo.InsertOneResult, error)
func SetupMongoDB ¶
func SetupMongoDB() error
Types ¶
type MongoEntity ¶
type MongoEntity struct {
// contains filtered or unexported fields
}
func (*MongoEntity) CheckConnectivity ¶
func (collection *MongoEntity) CheckConnectivity() error
func (*MongoEntity) ORMFindOneById ¶
func (collection *MongoEntity) ORMFindOneById(id interface{}) (*mongo.SingleResult, error)
func (*MongoEntity) ORMInsertOne ¶
func (collection *MongoEntity) ORMInsertOne(document interface{}) (*mongo.InsertOneResult, error)
type MongoORM ¶
type MongoORM interface { ORMInsertOne(document interface{}) (*mongo.InsertOneResult, error) ORMFindOneById(id interface{}) (*mongo.SingleResult, error) CheckConnectivity() error }
Click to show internal directories.
Click to hide internal directories.