package
0.0.0-20250331114127-736dde6625db
Repository: https://github.com/sdslabs/gasper.git
Documentation: pkg.go.dev
# Functions
BulkRegisterMetrics is an abstraction over InsertMany which inserts multiple metrics documents into the mongoDB.
BulkUpsert upserts multiple documents using BulkWrite.
CountDocs returns the number of documents matching a filter.
CountInstanceInTimeFrame returns the number of instances created by a user.
CountInstances returns the number of instances matching a filter.
CountInstancesByUser returns the number of specified instances by the user.
CountServiceInstances returns the number of applications of a given service deployed in a host machine.
CountUsers returns the number of users matching a filter.
DeleteInstance is an abstraction over DeleteOne which deletes an application from mongoDB.
DeleteInstances is an abstraction over DeleteMany which deletes applications from mongoDB.
DeleteMany deletes multiple documents from a mongoDB collection.
DeleteMetrics is an abstraction over DeleteOne which deletes a container metrics from mongoDB.
DeleteOne deletes a document from a mongoDB collection.
DeleteUser is an abstraction over DeleteOne which deletes a user from mongoDB.
FetchAppInfo is an abstraction over FetchDocs for retrieving application related documents.
FetchContainerMetrics is an abstraction over FetchDocs for retrieving metrics of a container.
FetchDatabaseLanguage returns the language of a database.
FetchDBInfo is an abstraction over FetchDocs for retrieving database related documents.
FetchDocs is a generic function which takes a collection name and mongoDB filter as input and returns documents.
FetchInstanceField returns the value of a given field from an instance.
FetchInstances is an abstraction over FetchDocs for retrieving any instance documents.
FetchSingleApp returns an application based on a name based filter.
FetchSingleDatabase returns a database based on a name based filter.
FetchSingleUser returns a user based on a email based filter.
FetchSingleUserWithoutPassword returns a user based on a email based filter without his/her password.
FetchUserInfo is an abstraction over FetchDocs for retrieving user details.
InsertMany inserts multiple document into a mongoDB collection.
InsertOne inserts a document into a mongoDB collection.
RegisterInstance is an abstraction over InsertOne which inserts application info into mongoDB.
RegisterMetrics is an abstraction over InsertOne which inserts metrics into the mongoDB.
RegisterUser is an abstraction over InsertOne which inserts user into the mongoDB.
UpdateInstance is an abstraction over UpdateOne which updates an application in mongoDB.
UpdateInstances is an abstraction over UpdateMany which updates multiple applications in mongoDB.
UpdateMany updates multiple documents in the mongoDB collection.
UpdateOne updates a document in the mongoDB collection.
No description provided by the author
UpdateUser is an abstraction over UpdateOne which updates an application in mongoDB.
UpsertInstance is an abstraction over UpdateOne which updates an application in mongoDB or inserts it if the corresponding document doesn't exist.
UpsertMetrics is an abstraction over BulkUpsert which updates multiple metrics documents in mongoDB or inserts them if the corresponding document doesn't exist.
UpsertUser is an abstraction over UpdateOne which updates an application in mongoDB or inserts it if the corresponding document doesn't exist.
# Constants
AdminKey is the key denoting whether a user has superuser privileges or not.
AppInstance is app instance type name in the instances collection.
ContainerPortKey is the key holding the port of the container in which an application is deployed.
DatetimeKey is the key holding the timestamp of when the instance was created.
DBInstance is db instance type name in the instances collection.
EmailKey is the key holding the email of a user.
GctlUUIDKey is the key holding a unique key for authentication of user by jwt.
HostIPKey is the key holding the host IP address of an instance.
InstanceCollection is the collection for all the instances.
InstanceTypeKey is the key holding the instance type of an instance.
LanguageKey is the key holding the language of an instance.
MetricsCollection is the collection to hold the metrics of the instances.
MongoDB is db instance type name in the instances collection.
Mysql is db instance type name for mysql database in the instances collection.
NameKey is the key holding the name of an instance.
OwnerKey is the key holding the owner of an instance.
PasswordKey is the key holding the password of a user/instance.
PortKey is the key holding the port of the container in which a database server is deployed.
TimestampKey is the key holding the timestamp of when a metrics collection was inserted.
UserCollection is the collection for all users.
UsernameKey is the key holding the username of a user.
# Variables
ErrNoDocuments is the error when no matching documents are found for an update operation.