mongodb

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

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
}

func GetMongoDriver

func GetMongoDriver(driverCredentials *models.DriverCredentials) (*SystemMongoDriver, error)

GetMongoDriver creates a new MongoDB system driver instance

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 adds metadata to team members using MongoDB

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) 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) 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) DeleteProjectFromSystem

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

DeleteProjectFromSystem deletes a project and all related data using MongoDB

func (*SystemMongoDriver) DeleteWebhook

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

DeleteWebhook deletes a webhook using MongoDB

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) 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) 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) GetProjects

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

GetProjects retrieves multiple projects by their IDs using MongoDB

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 team members for a project using MongoDB

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) Ping added in v1.0.7

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 runs the database migrations for MongoDB (creates necessary collections and indexes)

func (*SystemMongoDriver) SaveAuditLog

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

SaveAuditLog saves an audit log entry using MongoDB

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) 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) SearchUsers

SearchUsers searches for system users based on parameters using MongoDB

func (*SystemMongoDriver) SearchWebHooks

SearchWebHooks searches for webhooks in a project using MongoDB

func (*SystemMongoDriver) UpdateProject

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

UpdateProject updates a project using MongoDB

func (*SystemMongoDriver) UpdateSystemUser

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

UpdateSystemUser updates a system user using MongoDB

Jump to

Keyboard shortcuts

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