database

package
v0.0.0-...-db4faff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL