Documentation
¶
Index ¶
- func CreateConnection() (*mongo.Collection, context.CancelFunc)
- func DeleteSingleDocument(objectName string, collection *mongo.Collection) *mongo.DeleteResult
- func GetAllObjects(collection *mongo.Collection) []byte
- func GetSingleDocument(objectName string, collection *mongo.Collection) []byte
- func InsertSingleDocument(byteKubeObject []byte, collection *mongo.Collection) *mongo.InsertOneResult
- func UpdateDocument(updatedKubeObject kubeObject, collection *mongo.Collection)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateConnection ¶
func CreateConnection() (*mongo.Collection, context.CancelFunc)
CreateConnection creates a connection to MongoDB Atlas database and returns *mongo.Collection along with context.CancelFunc
func DeleteSingleDocument ¶
func DeleteSingleDocument(objectName string, collection *mongo.Collection) *mongo.DeleteResult
DeleteSingleDocument deletes the object document from database that matches the given object name
func GetAllObjects ¶
func GetAllObjects(collection *mongo.Collection) []byte
GetAllObjects gets all the objects from mongo collection
func GetSingleDocument ¶
func GetSingleDocument(objectName string, collection *mongo.Collection) []byte
GetSingleDocument gets single document from database that matches the kubernetes Object Name
func InsertSingleDocument ¶
func InsertSingleDocument(byteKubeObject []byte, collection *mongo.Collection) *mongo.InsertOneResult
InsertSIngleDocument inserts the Single document to mongodb collection
func UpdateDocument ¶
func UpdateDocument(updatedKubeObject kubeObject, collection *mongo.Collection)
UpdateDocument adds new kubernetes object in the database
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.