mongodb

package
v1.0.31 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SystemMongoDriver

type SystemMongoDriver struct {
	Client           *mongo.Client
	Database         *mongo.Database
	DriverCredential *models.DriverCredentials
	// Conf is open-core models.Config; OSSBootstrapProjectDriver uses SYSTEM_DB_* + starter constants for the starter project.
	Conf *models.Config
}

func GetSystemMongoDriver

func GetSystemMongoDriver(driverCredentials *models.DriverCredentials, conf *models.Config) (*SystemMongoDriver, error)

GetSystemMongoDriver creates a new MongoDB system driver instance. conf may be nil (e.g. CLI tools); bootstrap and CreateProject then skip default project driver from env.

func (*SystemMongoDriver) AddATeamMemberToProject

func (m *SystemMongoDriver) AddATeamMemberToProject(ctx context.Context, req *models.TeamMemberAddRequest) error

AddATeamMemberToProject adds a team member to a project using MongoDB

func (*SystemMongoDriver) AddSystemUserMetaInfo

AddSystemUserMetaInfo adds metadata to a system user using MongoDB

func (*SystemMongoDriver) AddTeamMetaInfo

func (m *SystemMongoDriver) AddTeamMetaInfo(ctx context.Context, docs []*models.SystemUser) ([]*models.SystemUser, error)

AddTeamMetaInfo is retired; membership lives on user_projects.

func (*SystemMongoDriver) AddWebhookToProject

func (m *SystemMongoDriver) AddWebhookToProject(ctx context.Context, doc *models.Webhook) (*models.Webhook, error)

AddWebhookToProject adds a webhook to a project using MongoDB

func (*SystemMongoDriver) AssignProjectToOrganization

func (m *SystemMongoDriver) AssignProjectToOrganization(ctx context.Context, orgId, userId, projectId string) error

AssignProjectToOrganization assigns a project to an organization using MongoDB

func (*SystemMongoDriver) AssignTeamToOrganization

func (m *SystemMongoDriver) AssignTeamToOrganization(ctx context.Context, orgId, userId, teamId string) error

AssignTeamToOrganization assigns a team to an organization using MongoDB

func (*SystemMongoDriver) BlacklistAToken

func (m *SystemMongoDriver) BlacklistAToken(ctx context.Context, token map[string]interface{}) error

BlacklistAToken adds a token to the blacklist using MongoDB

func (*SystemMongoDriver) CheckProjectName

func (m *SystemMongoDriver) CheckProjectName(ctx context.Context, name string) error

CheckProjectName checks if a project name already exists using MongoDB

func (*SystemMongoDriver) CheckProjectWithRoles

func (m *SystemMongoDriver) CheckProjectWithRoles(ctx context.Context, userId, projectId string) (*models.ProjectWithRoles, error)

CheckProjectWithRoles checks if a user belongs to a project and returns roles/permissions using MongoDB

func (*SystemMongoDriver) CheckTeamMemberExists

func (m *SystemMongoDriver) CheckTeamMemberExists(ctx context.Context, projectId string, memberID string) error

CheckTeamMemberExists checks if a team member exists in a project using MongoDB

func (*SystemMongoDriver) CheckTokenBlacklisted

func (m *SystemMongoDriver) CheckTokenBlacklisted(ctx context.Context, tokenId string) error

CheckTokenBlacklisted checks if a token is blacklisted using MongoDB

func (*SystemMongoDriver) CountProjectUsersByRole

func (m *SystemMongoDriver) CountProjectUsersByRole(ctx context.Context, projectID string) (map[string]int, error)

func (*SystemMongoDriver) CreateOrganization

func (m *SystemMongoDriver) CreateOrganization(ctx context.Context, org *models.Organization) (*models.Organization, error)

CreateOrganization creates a new organization using MongoDB

func (*SystemMongoDriver) CreateProject

func (m *SystemMongoDriver) CreateProject(ctx context.Context, userId string, project *models.Project) (*models.Project, error)

CreateProject creates a new project using MongoDB

func (*SystemMongoDriver) CreateSchemaOperation

func (m *SystemMongoDriver) CreateSchemaOperation(ctx context.Context, op *models.SchemaOperation) error

func (*SystemMongoDriver) CreateSystemUser

func (m *SystemMongoDriver) CreateSystemUser(ctx context.Context, user *models.SystemUser) (*models.SystemUser, error)

CreateSystemUser creates a new system user using MongoDB

func (*SystemMongoDriver) CreateTeam

func (m *SystemMongoDriver) CreateTeam(ctx context.Context, team *models.Team) (*models.Team, error)

CreateTeam creates a new team using MongoDB

func (*SystemMongoDriver) CreateUser

func (m *SystemMongoDriver) CreateUser(ctx context.Context, row *models.User) (*models.User, error)

func (*SystemMongoDriver) DeleteModelType

func (m *SystemMongoDriver) DeleteModelType(ctx context.Context, projectID, modelName string) error

DeleteModelType removes one model from the embedded schema.

func (*SystemMongoDriver) DeletePaymentProviderEvent added in v1.0.31

func (m *SystemMongoDriver) DeletePaymentProviderEvent(ctx context.Context, projectID, provider, eventID string) error

func (*SystemMongoDriver) DeleteProjectFromSystem

func (m *SystemMongoDriver) DeleteProjectFromSystem(ctx context.Context, projectId string) error

DeleteProjectFromSystem deletes a project and all related data using MongoDB

func (*SystemMongoDriver) DeleteUser

func (m *SystemMongoDriver) DeleteUser(ctx context.Context, projectID, userID string) error

func (*SystemMongoDriver) DeleteWebhook

func (m *SystemMongoDriver) DeleteWebhook(ctx context.Context, projectId, hookId string) error

DeleteWebhook deletes a webhook using MongoDB

func (*SystemMongoDriver) EnsureSystemBootstrap

func (m *SystemMongoDriver) EnsureSystemBootstrap(ctx context.Context) error

EnsureSystemBootstrap creates default admin, then default team/org/project and junction rows when needed.

func (*SystemMongoDriver) FindOrganizationAdmin

func (m *SystemMongoDriver) FindOrganizationAdmin(ctx context.Context, orgId string) (*models.SystemUser, error)

FindOrganizationAdmin retrieves the admin of an organization using MongoDB

func (*SystemMongoDriver) FindPaymentSubscriptionByProviderRef added in v1.0.31

func (m *SystemMongoDriver) FindPaymentSubscriptionByProviderRef(ctx context.Context, projectID, provider, providerSubscriptionID string) (*models.PaymentSubscription, error)

func (*SystemMongoDriver) FindPaymentTransactionByClientRef added in v1.0.31

func (m *SystemMongoDriver) FindPaymentTransactionByClientRef(ctx context.Context, projectID, provider, clientRef string) (*models.PaymentTransaction, error)

func (*SystemMongoDriver) FindPaymentTransactionByIdempotency added in v1.0.31

func (m *SystemMongoDriver) FindPaymentTransactionByIdempotency(ctx context.Context, projectID, key string) (*models.PaymentTransaction, error)

func (*SystemMongoDriver) FindUserOrganizations

func (m *SystemMongoDriver) FindUserOrganizations(ctx context.Context, userId string) ([]*models.Organization, error)

FindUserOrganizations retrieves all organizations for a given user using MongoDB

func (*SystemMongoDriver) FindUserProjects

func (m *SystemMongoDriver) FindUserProjects(ctx context.Context, userId string) ([]*models.Project, error)

FindUserProjects retrieves all projects for a given user using MongoDB

func (*SystemMongoDriver) FindUserProjectsWithRoles

func (m *SystemMongoDriver) FindUserProjectsWithRoles(ctx context.Context, userId string) ([]*models.ProjectWithRoles, error)

FindUserProjectsWithRoles retrieves user projects with their roles and permissions using MongoDB

func (*SystemMongoDriver) FindUserTeams

func (m *SystemMongoDriver) FindUserTeams(ctx context.Context, userId string) ([]*models.Team, error)

FindUserTeams retrieves all teams for a given user using MongoDB

func (*SystemMongoDriver) GetOrganizations

func (m *SystemMongoDriver) GetOrganizations(ctx context.Context, userId string) (*models.SearchResponse[models.Organization], error)

GetOrganizations retrieves organizations for a given user using MongoDB

func (*SystemMongoDriver) GetPaymentSubscription added in v1.0.31

func (m *SystemMongoDriver) GetPaymentSubscription(ctx context.Context, projectID, id string) (*models.PaymentSubscription, error)

func (*SystemMongoDriver) GetPaymentTransaction added in v1.0.31

func (m *SystemMongoDriver) GetPaymentTransaction(ctx context.Context, projectID, id string) (*models.PaymentTransaction, error)

func (*SystemMongoDriver) GetProject

func (m *SystemMongoDriver) GetProject(ctx context.Context, id string) (*models.Project, error)

GetProject retrieves a project by ID using MongoDB

func (*SystemMongoDriver) GetProjectTeams

func (m *SystemMongoDriver) GetProjectTeams(ctx context.Context, projectId string) (*models.Team, error)

GetProjectTeams retrieves team information for a project using MongoDB

func (*SystemMongoDriver) GetProjectUserSessionRevokedAfter added in v1.0.29

func (m *SystemMongoDriver) GetProjectUserSessionRevokedAfter(
	ctx context.Context,
	projectID, userID string,
) (int64, error)

func (*SystemMongoDriver) GetProjects

func (m *SystemMongoDriver) GetProjects(ctx context.Context, keys []string) ([]*models.Project, error)

GetProjects retrieves multiple projects by their IDs using MongoDB

func (*SystemMongoDriver) GetSchemaOperation

func (m *SystemMongoDriver) GetSchemaOperation(ctx context.Context, id string) (*models.SchemaOperation, error)

func (*SystemMongoDriver) GetSystemUser

func (m *SystemMongoDriver) GetSystemUser(ctx context.Context, id string) (*models.SystemUser, error)

GetSystemUser retrieves a system user by ID using MongoDB

func (*SystemMongoDriver) GetSystemUserByEmail

func (m *SystemMongoDriver) GetSystemUserByEmail(ctx context.Context, email string) (*models.SystemUser, error)

GetSystemUserByEmail retrieves a system user by email using MongoDB

func (*SystemMongoDriver) GetSystemUsers

func (m *SystemMongoDriver) GetSystemUsers(ctx context.Context, keys []string) ([]*models.SystemUser, error)

GetSystemUsers retrieves multiple system users by their IDs using MongoDB

func (*SystemMongoDriver) GetTeams

func (m *SystemMongoDriver) GetTeams(ctx context.Context, userId string) ([]*models.Team, error)

GetTeams retrieves teams for a given user using MongoDB

func (*SystemMongoDriver) GetTeamsMembers

func (m *SystemMongoDriver) GetTeamsMembers(ctx context.Context, projectId string) ([]*models.SystemUser, error)

GetTeamsMembers retrieves console operators for a project using MongoDB

func (*SystemMongoDriver) GetUser

func (m *SystemMongoDriver) GetUser(ctx context.Context, projectID, userID string) (*models.User, error)

func (*SystemMongoDriver) GetUserByUsername

func (m *SystemMongoDriver) GetUserByUsername(ctx context.Context, projectID, username string) (*models.User, error)

func (*SystemMongoDriver) GetWebHook

func (m *SystemMongoDriver) GetWebHook(ctx context.Context, projectId, hookId string) (*models.Webhook, error)

GetWebHook retrieves a specific webhook by ID using MongoDB

func (*SystemMongoDriver) InsertPaymentProviderEvent added in v1.0.31

func (m *SystemMongoDriver) InsertPaymentProviderEvent(ctx context.Context, row *models.PaymentProviderEvent) (bool, error)

func (*SystemMongoDriver) ListPaymentTransactions added in v1.0.31

func (m *SystemMongoDriver) ListPaymentTransactions(ctx context.Context, filter interfaces.PaymentListFilter) ([]*models.PaymentTransaction, error)

func (*SystemMongoDriver) ListSchemaOperationsByStatus

func (m *SystemMongoDriver) ListSchemaOperationsByStatus(ctx context.Context, projectID string, statuses []string, limit int) ([]*models.SchemaOperation, error)

func (*SystemMongoDriver) ListUsersByEmail

func (m *SystemMongoDriver) ListUsersByEmail(ctx context.Context, projectID, email string) ([]*models.User, error)

func (*SystemMongoDriver) ListUsersByGoogleSub

func (m *SystemMongoDriver) ListUsersByGoogleSub(ctx context.Context, projectID, googleSub string) ([]*models.User, error)

func (*SystemMongoDriver) ListUsersByPhone

func (m *SystemMongoDriver) ListUsersByPhone(ctx context.Context, projectID, phone string) ([]*models.User, error)

func (*SystemMongoDriver) PersistProjectModelTypes

func (m *SystemMongoDriver) PersistProjectModelTypes(ctx context.Context, projectID string, schemaModels []*models.ModelType) error

PersistProjectModelTypes is a no-op for MongoDB; schema is stored on the project document via UpdateProject.

func (*SystemMongoDriver) Ping

func (m *SystemMongoDriver) Ping() error

func (*SystemMongoDriver) RemoveATeamFromOrganization

func (m *SystemMongoDriver) RemoveATeamFromOrganization(ctx context.Context, orgId, userId, teamId string) error

RemoveATeamFromOrganization removes a team from an organization using MongoDB

func (*SystemMongoDriver) RemoveATeamMemberFromProject

func (m *SystemMongoDriver) RemoveATeamMemberFromProject(ctx context.Context, projectId string, memberID string) error

RemoveATeamMemberFromProject removes a team member from a project using MongoDB

func (*SystemMongoDriver) RemoveProjectFromOrganization

func (m *SystemMongoDriver) RemoveProjectFromOrganization(ctx context.Context, orgId, userId, projectId string) error

RemoveProjectFromOrganization removes a project from an organization using MongoDB

func (*SystemMongoDriver) RunMigration

func (m *SystemMongoDriver) RunMigration(ctx context.Context) error

RunMigration ensures collections and indexes exist. Idempotent (safe on every startup). Plain Mongo collections; names like user_project_edges mirror common Atlas layouts, not Arango graph semantics.

func (*SystemMongoDriver) SaveAuditLog

func (m *SystemMongoDriver) SaveAuditLog(ctx context.Context, auditLog *models.AuditLogs) error

SaveAuditLog saves an audit log entry using MongoDB

func (*SystemMongoDriver) SaveProjectAuthenticationSettings

func (m *SystemMongoDriver) SaveProjectAuthenticationSettings(ctx context.Context, projectID string, auth *models.AuthenticationSettings) error

SaveProjectAuthenticationSettings merges authentication_settings on the project document.

func (*SystemMongoDriver) SaveProjectStorageSettings

func (m *SystemMongoDriver) SaveProjectStorageSettings(ctx context.Context, projectID string, storage *models.StorageSettings) error

SaveProjectStorageSettings merges storage_settings on the project document.

func (*SystemMongoDriver) SaveRawData

func (m *SystemMongoDriver) SaveRawData(ctx context.Context, collection string, data map[string]interface{}) error

SaveRawData saves raw data using MongoDB for payment-related operations

func (*SystemMongoDriver) SearchAuditLogs

SearchAuditLogs searches for audit logs based on common system parameters using MongoDB

func (*SystemMongoDriver) SearchFunctions

SearchFunctions searches for cloud functions in a project using MongoDB

func (*SystemMongoDriver) SearchProjectUsers

func (m *SystemMongoDriver) SearchProjectUsers(ctx context.Context, projectID, q string, limit, offset int) ([]*models.User, int, error)

func (*SystemMongoDriver) SearchProjects

SearchProjects searches for projects based on common system parameters using MongoDB

func (*SystemMongoDriver) SearchResource

SearchResource searches for resources based on common system parameters using MongoDB

func (*SystemMongoDriver) SearchSystemUsers

SearchSystemUsers searches for system users based on parameters using MongoDB

func (*SystemMongoDriver) SearchWebHooks

SearchWebHooks searches for webhooks in a project using MongoDB

func (*SystemMongoDriver) SetProjectUserSessionRevokedAfter added in v1.0.29

func (m *SystemMongoDriver) SetProjectUserSessionRevokedAfter(
	ctx context.Context,
	projectID, userID string,
	revokedAfter int64,
) error

func (*SystemMongoDriver) TouchProjectUpdatedAt

func (m *SystemMongoDriver) TouchProjectUpdatedAt(ctx context.Context, projectID string) error

TouchProjectUpdatedAt updates only the project document timestamp.

func (*SystemMongoDriver) UpdateProject

func (m *SystemMongoDriver) UpdateProject(ctx context.Context, project *models.Project, replace bool) error

UpdateProject updates a project using MongoDB

func (*SystemMongoDriver) UpdateSchemaOperation

func (m *SystemMongoDriver) UpdateSchemaOperation(ctx context.Context, op *models.SchemaOperation) error

func (*SystemMongoDriver) UpdateSystemUser

func (m *SystemMongoDriver) UpdateSystemUser(ctx context.Context, user *models.SystemUser, replace bool) error

UpdateSystemUser updates a system user using MongoDB

func (*SystemMongoDriver) UpdateUser

func (m *SystemMongoDriver) UpdateUser(ctx context.Context, row *models.User) error

func (*SystemMongoDriver) UpsertModelType

func (m *SystemMongoDriver) UpsertModelType(ctx context.Context, projectID string, mt *models.ModelType) error

UpsertModelType merges one model into the project document and saves.

func (*SystemMongoDriver) UpsertPaymentSubscription added in v1.0.31

func (m *SystemMongoDriver) UpsertPaymentSubscription(ctx context.Context, row *models.PaymentSubscription) error

func (*SystemMongoDriver) UpsertPaymentTransaction added in v1.0.31

func (m *SystemMongoDriver) UpsertPaymentTransaction(ctx context.Context, row *models.PaymentTransaction) error

Jump to

Keyboard shortcuts

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